]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/log
FreeBSD/stable/9.git
12 years agoMFC r227840, r227846:
trociny [Mon, 30 Jan 2012 19:34:41 +0000 (19:34 +0000)]
MFC r227840, r227846:

r227840:

No need in procfs(5).

r227846

Remove yet another outdated note about procfs(5) being required.

Spotted by: arundel

git-svn-id: svn://svn.freebsd.org/base/stable/9@230781 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r227839, r230146:
trociny [Mon, 30 Jan 2012 19:32:33 +0000 (19:32 +0000)]
MFC r227839, r230146:

r227839:

Now kvm_getenvv() and kvm_getargv() don't need procfs(5).

r230146:

In kvm_argv(), the case when the supplied buffer was too short to hold the
requested value was handled incorrectly, and the function retuned NULL
instead of the truncated result.

Fix this and also remove unnecessary check for buf != NULL, which alway
retuns true.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230780 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230613:
pluknet [Mon, 30 Jan 2012 12:28:22 +0000 (12:28 +0000)]
MFC r230613:
Remove a left-over reference to make.conf(5) for now-defunct -DVM_STACK

git-svn-id: svn://svn.freebsd.org/base/stable/9@230771 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230531: Remove unused variable.
pluknet [Mon, 30 Jan 2012 12:10:37 +0000 (12:10 +0000)]
MFC r230531: Remove unused variable.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230769 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230064:
truckman [Mon, 30 Jan 2012 07:20:52 +0000 (07:20 +0000)]
MFC r230064:

Allow an MBR primary or extended Linux swap partition to be specified
as the system dump device.  This was already allowed for GPT.  The Linux
swap metadata at the beginning of the partition should not be disturbed
because the crash dump is written at the end.

Reviewed by: alfred, pjd, marcel

git-svn-id: svn://svn.freebsd.org/base/stable/9@230763 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230101:
mckusick [Sun, 29 Jan 2012 23:04:29 +0000 (23:04 +0000)]
MFC r230101:

Convert FFS mount error messages from kernel printf's to using the
vfs_mount_error error message facility provided by the nmount
interface.

Clean up formatting of mount warnings which still need to use
kernel printf's since they do not return errors.

Requested by: Craig Rodrigues <rodrigc@crodrigues.org>

git-svn-id: svn://svn.freebsd.org/base/stable/9@230760 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r228268:
trociny [Sun, 29 Jan 2012 21:13:36 +0000 (21:13 +0000)]
MFC r228268:

Protect process environment variables with p_candebug().

Discussed with: jilles, kib, rwatson

git-svn-id: svn://svn.freebsd.org/base/stable/9@230755 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r227833, r227834, r227836, r227874, r227955, r228029, r228030, r228046,
trociny [Sun, 29 Jan 2012 21:08:24 +0000 (21:08 +0000)]
MFC r227833, r227834, r227836, r227874, r227955, r228029, r228030, r228046,
 r228264, r228288, r228302, r228648, r228666, r230145, r230470, r230550:

New kern.proc sysctls.

r227833, r227874:

Add new sysctls, KERN_PROC_ENV and KERN_PROC_AUXV, to return
environment strings and ELF auxiliary vectors from a process stack.

Make sysctl_kern_proc_args to read not cached arguments from the
process stack.

Export proc_getargv() and proc_getenvv() so they can be reused by
procfs and linprocfs.

Suggested by: kib
Reviewed by: kib
Discussed with: kib, rwatson, jilles
Tested by: pho

MFC r227834:

In procfs_doproccmdline() if arguments are not cashed read them from
the process stack.

Suggested by: kib
Reviewed by: kib
Tested by: pho

MFC r227836:

Retire linprocfs_doargv(). Instead use new functions, proc_getargv()
and proc_getenvv(), which were implemented using linprocfs_doargv() as
a reference.

Suggested by: kib
Reviewed by: kib
Approved by: des (linprocfs maintainer)

r227955:

Add sysctl to get process resource limits.

Reviewed by: kib

r228029:

In sysctl_kern_proc_auxv the process was released too early: we still
need to hold it when checking process sv_flags.

r228030, r228046:

Add sysctl to retrieve ps_strings structure location of another process.

Suggested by: kib
Reviewed by: kib

r228264:

In sysctl_kern_proc_ps_strings() there is no much sense in checking
for P_WEXIT and P_SYSTEM flags.

Reviewed by: kib

r228288, r228302:

Protect kern.proc.auxv and kern.proc.ps_strings sysctls with p_candebug().

Citing jilles:

If we are ever going to do ASLR, the AUXV information tells an attacker
where the stack, executable and RTLD are located, which defeats much of
the point of randomizing the addresses in the first place.

Given that the AUXV information seems to be used by debuggers only anyway,
I think it would be good to move it to p_candebug() now.

The full virtual memory maps (KERN_PROC_VMMAP, procstat -v) are already
under p_candebug().

Suggested by: jilles
Discussed with: rwatson

r228648:

On start most of sysctl_kern_proc functions use the same pattern:
locate a process calling pfind() and do some additional checks like
p_candebug(). To reduce this code duplication a new function pget() is
introduced and used.

As the function may be useful not only in kern_proc.c it is in the
kernel name space.

Suggested by: kib
Reviewed by: kib

r228666:

Fix style and white spaces.

MFC r230145:

Abrogate nchr argument in proc_getargv() and proc_getenvv(): we always want
to read strings completely to know the actual size.

As a side effect it fixes the issue with kern.proc.args and kern.proc.env
sysctls, which didn't return the size of available data when calling
sysctl(3) with the NULL argument for oldp.

Note, in get_ps_strings(), which does actual work for proc_getargv() and
proc_getenvv(), we still have a safety limit on the size of data read in
case of a corrupted procces stack.

Suggested by: kib

r230470:

Change kern.proc.rlimit sysctl to:

- retrive only one, specified limit for a process, not the whole
  array, as it was previously (the sysctl has been added recently and
  has not been backported to stable yet, so this change is ok);

- allow to set a resource limit for another process.

Submitted by: Andrey Zonov <andrey at zonov.org>
Discussed with: kib
Reviewed by: kib

r230550:

Fix CTL flags in the declarations of KERN_PROC_ENV, AUXV and
PS_STRINGS sysctls: they are read only.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230754 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r226449:
jhibbits [Sun, 29 Jan 2012 18:54:25 +0000 (18:54 +0000)]
MFC r226449:

Add support for special keys (volume/brightness/eject) on Apple laptops with
ADB keyboards.

Approved by: nwhitehorn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@230751 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r228858
marius [Sun, 29 Jan 2012 15:00:31 +0000 (15:00 +0000)]
MFC: r228858

Update a comment to reflect reality and explain why we're using the
medany code model.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230746 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r228857
marius [Sun, 29 Jan 2012 14:55:20 +0000 (14:55 +0000)]
MFC: r228857

On FreeBSD just use the MD5 implementation of libmd rather than that of
libcrypto so we don't need to relinquish csup when world is built without
OpenSSL.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230743 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r228211
marius [Sun, 29 Jan 2012 12:58:06 +0000 (12:58 +0000)]
MFC: r228211

It doesn't make much sense to check whether child is NULL after already
having dereferenced it. We either should generally check the device_t's
supplied to bus functions before using them (which we seem to virtually
never do) or just assume that they are not NULL.
While at it make this code fit 78 columns.

Found with: Coverity Prevent(tm)
CID: 4230

git-svn-id: svn://svn.freebsd.org/base/stable/9@230740 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r228209
marius [Sun, 29 Jan 2012 12:56:18 +0000 (12:56 +0000)]
MFC: r228209

- In device_probe_child(9) check the return value of device_set_driver(9)
  when actually setting a driver as especially ENOMEM is fatal in these
  cases.
- Annotate other calls to device_set_devclass(9) and device_set_driver(9)
  without the return value being checked and that are okay to fail.

Reviewed by: yongari (slightly earlier version)

git-svn-id: svn://svn.freebsd.org/base/stable/9@230738 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r228027
marius [Sun, 29 Jan 2012 12:54:31 +0000 (12:54 +0000)]
MFC: r228027

Move the scsi_da_bios_params() prototype from pc98_machdep.h to md_var.h
where the prototype for pc98_ata_disk_firmware_geom_adjust() also lives
in order to avoid an #ifdef'ed include in cam(4).

git-svn-id: svn://svn.freebsd.org/base/stable/9@230736 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r228024
marius [Sun, 29 Jan 2012 12:52:34 +0000 (12:52 +0000)]
MFC: r228024

Update comment.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230734 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r228005
marius [Sun, 29 Jan 2012 12:50:43 +0000 (12:50 +0000)]
MFC: r228005

Change another instance of amd(4) to esp(4) missed in r227006 (MFC'ed to
stable/9 in r227305).

Submitted by: Garrett Cooper

git-svn-id: svn://svn.freebsd.org/base/stable/9@230733 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230449:
mm [Sun, 29 Jan 2012 12:25:21 +0000 (12:25 +0000)]
MFC r230449:
Merge illumos revisions 13540, 13562:

illumos rev 13540 [1]:
Removal of pyzfs broke delegation for volumes

illumos rev 13562 [2]:
zfs allow arguments not parsed correctly after pyzfs removal

References:
https://www.illumos.org/issues/1726 [1]
https://www.illumos.org/issues/1977 [2]

Obtained from: illumos (issues #1726, #1977)

git-svn-id: svn://svn.freebsd.org/base/stable/9@230730 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229002:
dumbbell [Sun, 29 Jan 2012 10:55:19 +0000 (10:55 +0000)]
MFC r229002:
Set svn:executable on dhclient-script

Sponsored by: Yakaz (http://www.yakaz.com)

git-svn-id: svn://svn.freebsd.org/base/stable/9@230728 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230249:
mckusick [Sun, 29 Jan 2012 08:03:45 +0000 (08:03 +0000)]
MFC r230249:

Make sure all intermediate variables holding mount flags (mnt_flag)
and that all internal kernel calls passing mount flags are declared
as uint64_t so that flags in the top 32-bits are not lost.

MFC r230250:

There are several bugs/hangs when trying to take a snapshot on a UFS/FFS
filesystem running with journaled soft updates. Until these problems
have been tracked down, return ENOTSUPP when an attempt is made to
take a snapshot on a filesystem running with journaled soft updates.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230725 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230460:
kib [Sun, 29 Jan 2012 04:42:19 +0000 (04:42 +0000)]
MFC r230460:
Clarify the implementation-defined behaviour in case of close(2)
returning error.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230723 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r227912
marius [Sun, 29 Jan 2012 01:40:37 +0000 (01:40 +0000)]
MFC: r227912

- Just use cam_calc_geometry(9) on newer version of FreeBSD rather than
  duplicating it.
- In hptmv(4) and hptrr(4) use __FBSDID and DEVMETHOD_END.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230719 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r227907, r22791 (for diff reduction)
marius [Sun, 29 Jan 2012 01:32:24 +0000 (01:32 +0000)]
MFC: r227907, r22791 (for diff reduction)

Add BCM5785 but wrap it in #ifdef notyet for now. According to yongari@ there
are issues probably needing workarounds in bge(4) when brgphy(4) handles this
PHY. Letting ukphy(4) handle it instead results in a working configuration,
although likely with performance penalties.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230717 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r227906
marius [Sun, 29 Jan 2012 01:29:31 +0000 (01:29 +0000)]
MFC: r227906

Sync with NetBSD rev. 1.104

Obtained from: NetBSD

git-svn-id: svn://svn.freebsd.org/base/stable/9@230716 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r227688
marius [Sun, 29 Jan 2012 01:01:32 +0000 (01:01 +0000)]
MFC: r227688

There's no need export the device interface methods of miibus(4).

git-svn-id: svn://svn.freebsd.org/base/stable/9@230711 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r227687, r228290
marius [Sun, 29 Jan 2012 01:00:11 +0000 (01:00 +0000)]
MFC: r227687, r228290

- Add a hint.miibus.X.phymask hint, allowing do individually exclude PHY
  addresses from being probed and attaching something including ukphy(4)
  to it. This is mainly necessarily for PHY switches that create duplicate
  or fake PHYs on the bus that can corrupt the PHY state when accessed or
  simply cause problems when ukphy(4) isolates the additional instances.
- Change miibus(4) to be a hinted bus, allowing to add child devices via
  hints and to set their attach arguments (including for automatically
  probed PHYs). This is mainly needed for PHY switches that violate IEEE
  802.3 and don't even implement the basic register set so we can't probe
  them automatically. However, the ability to alter the attach arguments
  for automatically probed PHYs is also useful as for example it allows
  to test (or tell a user to test) new variant of a PHY with a specific
  driver by letting an existing driver attach to it via manipulating the
  IDs without the need to touch the source code or to limit a Gigabit
  Ethernet PHY to only announce up to Fast Ethernet in order to save
  energy  by limiting the capability mask. Generally, a driver has to
  be hinted via hint.phydrv.X.at="miibusY" and hint.phydrv.X.phyno="Z"
  (which already is sufficient to add phydrvX at miibusY at PHY address
  Z). Then optionally the following attach arguments additionally can
  be configured:
  hint.phydrv.X.id1
  hint.phydrv.X.id2
  hint.phydrv.X.capmask
- Some minor cleanup.

Reviewed by: adrian, ray

git-svn-id: svn://svn.freebsd.org/base/stable/9@230709 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r227686
marius [Sun, 29 Jan 2012 00:52:04 +0000 (00:52 +0000)]
MFC: r227686

There's no need to read DC_10BTSTAT twice in dcphy_status().

git-svn-id: svn://svn.freebsd.org/base/stable/9@230707 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r227685
marius [Sun, 29 Jan 2012 00:50:41 +0000 (00:50 +0000)]
MFC: r227685

- There's no need to ignore the return value of mii_attach(9) when attaching
  dcphy(4) (CID 9283).
- In dc_detach(), check whether ifp is NULL as dc_attach() may call the
  former without ifp being allocated (CID 4288).

Found with: Coverity Prevent(tm)

git-svn-id: svn://svn.freebsd.org/base/stable/9@230705 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r227043
marius [Sun, 29 Jan 2012 00:49:12 +0000 (00:49 +0000)]
MFC: r227043

Sprinkle some const.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230703 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r226950
marius [Sun, 29 Jan 2012 00:47:11 +0000 (00:47 +0000)]
MFC: r226950

Add multiple inclusion protection.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230701 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r226948
marius [Sun, 29 Jan 2012 00:45:52 +0000 (00:45 +0000)]
MFC: r226948

Remove unnecessary DMA constraints.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230699 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r226270
marius [Sun, 29 Jan 2012 00:42:54 +0000 (00:42 +0000)]
MFC: r226270

- Remove unused remnants of MII bitbang'ing.
- Sprinkle const.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230697 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r226175
marius [Sun, 29 Jan 2012 00:40:39 +0000 (00:40 +0000)]
MFC: r226175

In device_get_children() avoid malloc(0) in order to increase portability
to other operating systems.

PR: 154287

git-svn-id: svn://svn.freebsd.org/base/stable/9@230695 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r226171
marius [Sun, 29 Jan 2012 00:35:22 +0000 (00:35 +0000)]
MFC: r226171

Sprinkle const.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230694 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r226057
marius [Sun, 29 Jan 2012 00:32:37 +0000 (00:32 +0000)]
MFC: r226057

- Currently, sched_balance_pair() may cause a CPU to send an IPI_PREEMPT to
  itself, which sparc64 hardware doesn't support. One way to solve this
  would be to directly call sched_preempt() instead of issuing a self-IPI.
  However, quoting jhb@:
  "On the other hand, you can probably just skip the IPI entirely if we are
  going to send it to the current CPU.  Presumably, once this routine
  finishes, the current CPU will exit softlock (or will do so "soon") and
  will then pick the next thread to run based on the adjustments made in
  this routine, so there's no need to IPI the CPU running this routine
  anyway.  I think this is the better solution.  Right now what is probably
  happening on other platforms is as soon as this routine finishes the CPU
  processes its self-IPI and causes mi_switch() which will just switch back
  to the softclock thread it is already running."
- With r226054 (MFC'ed to stable/9 in r230690) and the the above change in
  place, sparc64 now no longer is incompatible with ULE and vice versa.
  However, powerpc/E500 still is.

Submitted by: jhb
Reviewed by: jeff

git-svn-id: svn://svn.freebsd.org/base/stable/9@230691 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r226054
marius [Sun, 29 Jan 2012 00:24:46 +0000 (00:24 +0000)]
MFC: r226054

- Use atomic operations rather than sched_lock for safely assigning pm_active
  and pc_pmap for SMP. This is key to allowing adding support for SCHED_ULE.
  Thanks go to Peter Jeremy for additional testing.
- Add support for SCHED_ULE to cpu_switch().

git-svn-id: svn://svn.freebsd.org/base/stable/9@230690 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r225931, r225932, r227000
marius [Sat, 28 Jan 2012 23:53:06 +0000 (23:53 +0000)]
MFC: r225931, r225932, r227000

Make sparc64 compatible with NEW_PCIB and enable it:
- Implement bus_adjust_resource() methods as far as necessary and in non-PCI
  bridge drivers as far as feasible without rototilling them.
- As NEW_PCIB does a layering violation by activating resources at layers
  above pci(4) without previously bubbling up their allocation there, move
  the assignment of bus tags and handles from the bus_alloc_resource() to
  the bus_activate_resource() methods like at least the other NEW_PCIB
  enabled architectures do. This is somewhat unfortunate as previously
  sparc64 (ab)used resource activation to indicate whether SYS_RES_MEMORY
  resources should be mapped into KVA, which is only necessary if their
  going to be accessed via the pointer returned from rman_get_virtual() but
  not for bus_space(9) as the later always uses physical access on sparc64.
  Besides wasting KVA if we always map in SYS_RES_MEMORY resources, a driver
  also may deliberately not map them in if the firmware already has done so,
  possibly in a special way. So in order to still allow a driver to decide
  whether a SYS_RES_MEMORY resource should be mapped into KVA we let it
  indicate that by calling bus_space_map(9) with BUS_SPACE_MAP_LINEAR as
  actually documented in the bus_space(9) page. This is implemented by
  allocating a separate bus tag per SYS_RES_MEMORY resource and passing the
  resource via the previously unused bus tag cookie so we later on can call
  rman_set_virtual() in sparc64_bus_mem_map(). As a side effect this now
  also allows to actually indicate that a SYS_RES_MEMORY resource should be
  mapped in as cacheable and/or read-only via BUS_SPACE_MAP_CACHEABLE and
  BUS_SPACE_MAP_READONLY respectively.
- Do some minor cleanup like taking advantage of rman_init_from_resource(),
  factor out the common part of bus tag allocation into a newly added
  sparc64_alloc_bus_tag(), hook up some missing newbus methods and replace
  some homegrown versions with the generic counterparts etc.
- While at it, let apb_attach() (which can't use the generic NEW_PCIB code
  as APB bridges just don't have the base and limit registers implemented)
  regarding the config space registers cached in pcib_softc and the SYSCTL
  reporting nodes set up.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230687 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r225901
marius [Sat, 28 Jan 2012 23:37:04 +0000 (23:37 +0000)]
MFC: r225901

Remove obsolete macros.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230683 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r225900
marius [Sat, 28 Jan 2012 23:35:24 +0000 (23:35 +0000)]
MFC: r225900

Nuke SUN4U #ifdef's which with the demise of sun4v no longer serve any
purpose.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230682 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r225899
marius [Sat, 28 Jan 2012 23:33:50 +0000 (23:33 +0000)]
MFC: r225899

Also allocate space for the PIL counters. Given that no machine actually
uses IV_MAX interrupt vectors this wasn't a problem in practice though.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230680 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r225891
marius [Sat, 28 Jan 2012 23:26:50 +0000 (23:26 +0000)]
MFC: r225891

Re-reading the Schizo errata suggests that it's actually tolerable to
also use the streaming buffer of pre version 5/revision 2.3 hardware as
long as we stay away from context flushes (which iommu(4) so far doesn't
take advantage of). OpenSolaris does the same.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230677 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r225890
marius [Sat, 28 Jan 2012 23:25:28 +0000 (23:25 +0000)]
MFC: r225890

- Add protective parentheses to macros as far as possible.
- Move {r,w,}mb() to the top of this file where they live on most of the
  other architectures.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230675 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r225889, r228222
marius [Sat, 28 Jan 2012 23:24:03 +0000 (23:24 +0000)]
MFC: r225889, r228222

In total store which we use for running the kernel and all of the userland
atomic operations behave as if they were followed by a CPU memory barrier
so there's no need to include ones in the acquire variants of atomic(9) and
it's sufficient to just use include compiler memory barriers to satisfy
the requirements of atomic(9). Removing the CPU memory barriers results in
a small performance improvement, specifically this is sufficient to
compensate the performance loss seen in the worldstone benchmark seen when
using SCHED_ULE instead of SCHED_4BSD.
This change is inspired by Linux even more radically doing the equivalent
thing some time ago.
Thanks go to Peter Jeremy for additional testing.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230673 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r225888
marius [Sat, 28 Jan 2012 23:17:58 +0000 (23:17 +0000)]
MFC: r225888

Add a comment about why contrary to what once would think running all of
userland with total store order actually is appropriate.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230671 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r225887
marius [Sat, 28 Jan 2012 23:16:47 +0000 (23:16 +0000)]
MFC: r225887

Use the extended integer condition code when comparing 64-bit values. Given
that ATOMIC_INC_LONG currently is unused this happened to not be fatal.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230669 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r225886
marius [Sat, 28 Jan 2012 23:15:02 +0000 (23:15 +0000)]
MFC: r225886

- Right-justify backslashes as suggested by style(9).
- Rename ATOMIC_INC_ULONG to ATOMIC_INC_LONG in order to be consistent with
  the names of the other macros in this file an adjust accordingly.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230667 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r228022, r228026
marius [Sat, 28 Jan 2012 23:12:55 +0000 (23:12 +0000)]
MFC: r228022, r228026

For sparc64 also adjust the geometry of da(4) driven disks to not overflow
the 16-bit cylinders field of the VTOC8 disk label (at around 502GB). The
geometry chosen for disks above that limit allows to use disks up to 2TB,
which is the limit of the extended VTOC8 format. The geometry used for
disks smaller than the 16-bit cylinders limit stays the same as used by
cam_calc_geometry(9) for extended translation.
Thanks to Hans-Joerg Sirtl for providing hardware for testing this change.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230665 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230327:
eadler [Sat, 28 Jan 2012 21:44:51 +0000 (21:44 +0000)]
MFC r230327:
 Add support for Sony Ericsson GC89 EDGE/Wirelles LAN PC Card

PR: kern/131933
Approved by: cperciva

git-svn-id: svn://svn.freebsd.org/base/stable/9@230659 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229831:
eadler [Sat, 28 Jan 2012 19:48:44 +0000 (19:48 +0000)]
MFC r229831:
- X11BASE has been deprecated for a long time and will die soon

Approved by: cperciva

git-svn-id: svn://svn.freebsd.org/base/stable/9@230653 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230109:
eadler [Sat, 28 Jan 2012 19:32:28 +0000 (19:32 +0000)]
MFC r230109:
 - Document TheDraw splash screens in the default loader.conf

Approved by: cperciva

git-svn-id: svn://svn.freebsd.org/base/stable/9@230650 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r230100
rmacklem [Sat, 28 Jan 2012 01:45:19 +0000 (01:45 +0000)]
MFC: r230100
Tai Horgan reported via email that there were two places in
the new NFSv4 server where the code follows the wrong list.
Fortunately, for these fairly rare cases, the lc_stateid[]
lists are normally empty. This patch fixes the code to
follow the correct list.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230637 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r228937: sh: Do not force special builtins non-special in optimized
jilles [Fri, 27 Jan 2012 21:22:07 +0000 (21:22 +0000)]
MFC r228937: sh: Do not force special builtins non-special in optimized
command substitition.

This is not necessary: errors are already caught in evalbackcmd() and
forcelocal handles changes to variables.

Note that this depends on r223024.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230625 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230095: sh: Properly show "Not a directory" error in cd builtin.
jilles [Fri, 27 Jan 2012 20:53:37 +0000 (20:53 +0000)]
MFC r230095: sh: Properly show "Not a directory" error in cd builtin.

The errno message display added in r222292 did not take attempting to
cd to a non-directory or something that cannot be stat()ed into account.

PR: bin/164070

git-svn-id: svn://svn.freebsd.org/base/stable/9@230624 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229284:
bschmidt [Fri, 27 Jan 2012 17:32:50 +0000 (17:32 +0000)]
MFC r229284:
MCS32 equals 32, not 8*ic_txstream.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230619 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229375:
bschmidt [Fri, 27 Jan 2012 17:29:59 +0000 (17:29 +0000)]
MFC r229375:
Don't rely on MCS7 being at index 7 while determining the amount
of antennas to use. Not all APs enable all MCS rates.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230618 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230496: Remove the stale XXX rt_newaddrmsg comment.
pluknet [Fri, 27 Jan 2012 07:15:14 +0000 (07:15 +0000)]
MFC r230496: Remove the stale XXX rt_newaddrmsg comment.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230607 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC 227460
qingli [Fri, 27 Jan 2012 02:13:27 +0000 (02:13 +0000)]
MFC 227460

A default route learned from the RAs could be deleted manually
after its installation. This removal may be accidental and can
prevent the default route from being installed in the future if
the associated default router has the best preference. The cause
is the lack of status update in the default router on the state
of its route installation in the kernel FIB. This patch fixes
the described problem.

Reviewed by: hrs, discussed with hrs

git-svn-id: svn://svn.freebsd.org/base/stable/9@230604 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r228259:
dumbbell [Thu, 26 Jan 2012 19:46:13 +0000 (19:46 +0000)]
MFC r228259:
Support domain-search in dhclient(8)

The "domain-search" option (option 119) allows a DHCP server to publish
a list of implicit domain suffixes used during name lookup. This option
is described in RFC 3397.

For instance, if the domain-search option says:
    ".example.org .example.com"
and one wants to resolve "foobar", the resolver will try:
    1. "foobar.example.org"
    2. "foobar.example.com"

The file /etc/resolv.conf is updated with a "search" directive if the
DHCP server provides "domain-search".

A regression test suite is included in this patch under
tools/regression/sbin/dhclient.

PR: bin/151940
Sponsored by: Yakaz (http://www.yakaz.com)

MFC r229000:
Invalid Domain Search option isn't considered as a fatal error

In the original Domain Search option patch, an invalid option value
would cause the whole lease to be rejected. However, DHCP servers who
emit such an invalid value are more common than I thought. With this new
patch, just the option is rejected, not the entire lease.

PR: bin/163431
Submitted by: Fabian Keil <fk@fabiankeil.de> (earlier version)
Reviewed by: Fabian Keil <fk@fabiankeil.de>
Sponsored by: Yakaz (http://www.yakaz.com)

MFC r229001:
Adapt testsuite following change in Domain Search error handling

In this testsuite, warning() and error() have the same behaviour.

PR: bin/163431
Sponsored by: Yakaz (http://www.yakaz.com)

git-svn-id: svn://svn.freebsd.org/base/stable/9@230597 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r227992:
dumbbell [Thu, 26 Jan 2012 19:15:13 +0000 (19:15 +0000)]
MFC r227992:

Prevent a division by zero with some broken batteries

This problem was seen on a laptop with a dead battery.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230595 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229916 (by eadler):
ae [Thu, 26 Jan 2012 06:57:47 +0000 (06:57 +0000)]
MFC r229916 (by eadler):
  Fix warning when compiling with gcc46:
 error: variable 'secsz' set but not used

git-svn-id: svn://svn.freebsd.org/base/stable/9@230563 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMerge r230127 from head/:
glebius [Wed, 25 Jan 2012 13:47:55 +0000 (13:47 +0000)]
Merge r230127 from head/:
  Restore functionality to pack several kernels into release. All
  kernels specified by KERNCONF are built and packed into release.
  The first one is packed into kernel.txz, all others to
  kernel.CONFIG.txz.

  The first one is installed on bootables in /boot.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230539 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230459:
kib [Wed, 25 Jan 2012 07:12:45 +0000 (07:12 +0000)]
MFC r230459:
Fix typo.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230527 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r229956
rmacklem [Wed, 25 Jan 2012 01:45:19 +0000 (01:45 +0000)]
MFC: r229956
jwd@ reported via email that the "CacheSize" field reported by "nfsstat -e -s"
would go negative after using the "-z" option to zero out the stats.
This patch fixes that by not zeroing out the srvcache_size field
for "-z", since it is the size of the cache and not a counter

git-svn-id: svn://svn.freebsd.org/base/stable/9@230518 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230270:
kib [Tue, 24 Jan 2012 11:48:06 +0000 (11:48 +0000)]
MFC r230270:
Add definitions for the FPU extended state header, legacy extended
state and AVX state.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230504 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230269:
kib [Tue, 24 Jan 2012 11:42:46 +0000 (11:42 +0000)]
MFC r230269:
Modernize the fpusave structures definitions by using uint*_t types.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230503 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230262:
kib [Tue, 24 Jan 2012 11:28:53 +0000 (11:28 +0000)]
MFC r230262:
Implement xsetbv(), xsave() and xrstor().

git-svn-id: svn://svn.freebsd.org/base/stable/9@230502 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230261:
kib [Tue, 24 Jan 2012 11:10:32 +0000 (11:10 +0000)]
MFC r230261:
Add definitions related to XCR0.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230501 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230260:
kib [Tue, 24 Jan 2012 10:56:40 +0000 (10:56 +0000)]
MFC r230260:
Add macro IS_BSP() to check whether the current CPU is BSP.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230499 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230256:
pluknet [Tue, 24 Jan 2012 10:28:19 +0000 (10:28 +0000)]
MFC r230256:
 Fix the "lock &zrl->zr_mtx already initialized" assertion by initializing
 the allocated memory before calling mtx_init(9) on mtx pointing to it.
 Otherwize, random contents of uninitialized memory might occasionally
 trigger the assertion.

 Reported by:  Pavel Polyakov <bsd kobyla org>
 Reviewed by:  pjd

git-svn-id: svn://svn.freebsd.org/base/stable/9@230497 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229694:
jh [Mon, 23 Jan 2012 16:28:35 +0000 (16:28 +0000)]
MFC r229694:

r222004 changed sbuf_finish() to not clear the buffer error status. As a
consequence sbuf_len() will return -1 for buffers which had the error
status set prior to sbuf_finish() call. This causes a problem in
pfs_read() which purposely uses a fixed size sbuf to discard bytes which
are not needed to fulfill the read request.

Work around the problem by using the full buffer length when
sbuf_finish() indicates an overflow. An overflowed sbuf with fixed size
is always full.

PR: kern/163076

git-svn-id: svn://svn.freebsd.org/base/stable/9@230485 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230402, r230404:
mm [Mon, 23 Jan 2012 08:29:58 +0000 (08:29 +0000)]
MFC r230402, r230404:
Add accidentially removed copyright lines in r228103

Reported by: pjd

git-svn-id: svn://svn.freebsd.org/base/stable/9@230476 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r228360
pho [Sun, 22 Jan 2012 18:27:24 +0000 (18:27 +0000)]
MFC: r228360

Move cpu_set_upcall(newtd, td) up before the first call of
thread_free(newtd).  This to avoid a possible page fault in
cpu_thread_clean() as seen on amd64 with syscall fuzzing.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230466 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229692:
jh [Sun, 22 Jan 2012 13:55:15 +0000 (13:55 +0000)]
MFC r229692:

Check the return value of sbuf_finish() in pfs_readlink() and return
ENAMETOOLONG if the buffer overflowed.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230462 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r229802
rmacklem [Sun, 22 Jan 2012 05:16:31 +0000 (05:16 +0000)]
MFC: r229802
opt_inet6.h was missing from some files in the new NFS subsystem.
The effect of this was, for clients mounted via inet6 addresses,
that the DRC cache would never have a hit in the server. It also
broke NFSv4 callbacks when an inet6 address was the only one available
in the client. This patch fixes the above, plus deletes opt_inet6.h
from a couple of files it is not needed for.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230446 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: revision 229463
nyan [Sun, 22 Jan 2012 04:19:03 +0000 (04:19 +0000)]
MFC: revision 229463

  MFi386: revision 229435

    Add special loader environment variables 'comconsole_port' and
    'comconsole_pcidev'.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230444 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230117: sh: Fix out of bounds array access when trap is used with an
jilles [Sat, 21 Jan 2012 21:54:31 +0000 (21:54 +0000)]
MFC r230117: sh: Fix out of bounds array access when trap is used with an
invalid signal.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230439 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r228923, r228935, and r229007
alc [Sat, 21 Jan 2012 19:21:42 +0000 (19:21 +0000)]
MFC r228923, r228935, and r229007
  Eliminate many of the unnecessary differences between the native and
  paravirtualized pmap implementations for i386.

  Fix a bug in the Xen pmap's implementation of
  pmap_extract_and_hold(): If the page lock acquisition is retried,
  then the underlying thread is not unpinned.

  Wrap nearby lines that exceed 80 columns.

  Merge r216333 and r216555 from the native pmap
    When r207410 eliminated the acquisition and release of the page
    queues lock from pmap_extract_and_hold(), it didn't take into
    account that pmap_pte_quick() sometimes requires the page queues
    lock to be held.  This change reimplements pmap_extract_and_hold()
    such that it no longer uses pmap_pte_quick(), and thus never
    requires the page queues lock.

  Merge r177525 from the native pmap
    Prevent the overflow in the calculation of the next page
    directory.  The overflow causes the wraparound with consequent
    corruption of the (almost) whole address space mapping.

  Strictly speaking, r177525 is not required by the Xen pmap because
  the hypervisor steals the uppermost region of the normal kernel
  address space.  I am nonetheless merging it in order to reduce the
  number of unnecessary differences between the native and Xen pmap
  implementations.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230435 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r228746
alc [Sat, 21 Jan 2012 18:11:12 +0000 (18:11 +0000)]
MFC r228746
  The Xen pmap doesn't support superpages.  So, there is no point in it
  initializing structures, like the pv table, that are only used to
  implement superpages.  In fact, some of the unnecessary code in
  pmap_init() was actually doing harm.  It was preventing the kernel from
  booting on virtual machines with more than 768 MB of memory.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230431 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r227827
rmh [Sat, 21 Jan 2012 17:22:50 +0000 (17:22 +0000)]
MFC r227827
  Define __FreeBSD_kernel__ macro in sys/param.h.

  __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
  which by definition is always true on FreeBSD. This macro is also defined
  on other systems that use the kernel of FreeBSD, such as GNU/kFreeBSD.

  It is tempting to use this macro in userland code when we want to enable
  kernel-specific routines, and in fact it's fine to do this in code that
  is part of FreeBSD itself.  However, be aware that as presence of this
  macro is still not widespread (e.g. older FreeBSD versions, 3rd party
  compilers, etc), it is STRONGLY DISCOURAGED to check for this macro in
  external applications without also checking for __FreeBSD__ as an
  alternative.

Approved by: kib (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@230425 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r228398
alc [Sat, 21 Jan 2012 08:26:41 +0000 (08:26 +0000)]
MFC r228398
  Avoid the possibility of integer overflow in the calculation of
  VM_KMEM_SIZE_MAX.  Specifically, if the user/kernel address space split
  was changed such that the kernel address space was greater than or equal
  to 2 GB, then overflow would occur.

PR: 161721

git-svn-id: svn://svn.freebsd.org/base/stable/9@230421 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r226163, r228317, and r228324
alc [Sat, 21 Jan 2012 05:03:10 +0000 (05:03 +0000)]
MFC r226163, r228317, and r228324
  Fix the handling of an empty kmem map by sysctl_kmem_map_free().

  Eliminate the possibility of 32-bit arithmetic overflow in the
  calculation of vm_kmem_size that may occur if the system
  administrator has specified a vm.vm_kmem_size tunable value that
  exceeds the hard cap.

  Eliminate stale numbers from a comment.

PR: 162741

git-svn-id: svn://svn.freebsd.org/base/stable/9@230418 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229898:
lstewart [Sat, 21 Jan 2012 03:59:31 +0000 (03:59 +0000)]
MFC r229898:

Consumers of bpfdetach() expect it to remove all bpf_if structs from the
bpf_iflist list which reference the specified ifnet. The existing implementation
only removes the first matching bpf_if found in the list, effectively leaking
list entries if an ifnet has been bpfattach()ed multiple times with different
DLTs.

Fix the leak by performing the detach logic in a loop, stopping when all bpf_if
structs referencing the specified ifnet have been detached and removed from the
bpf_iflist list.

Whilst here, also:

- Remove the unnecessary "bp->bif_ifp == NULL" check, as a bpf_if should never
  exist in the list with a NULL ifnet pointer.

- Except when INVARIANTS is in the kernel config, silently ignore the case where
  no bpf_if referencing the specified ifnet is found, as it is harmless and does
  not require user attention.

Reviewed by: csjp

git-svn-id: svn://svn.freebsd.org/base/stable/9@230415 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230294:
lstewart [Sat, 21 Jan 2012 03:16:32 +0000 (03:16 +0000)]
MFC r230294:

Specify the correct section (4 instead of 9) in the h_ertt man page's title and
bump the document date.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230412 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229768:
kib [Sat, 21 Jan 2012 01:24:06 +0000 (01:24 +0000)]
MFC r229768:
Implement fdlopen(3), an rtld interface to load shared object by file
descriptor.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230410 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r227124: fifo_misc test: Fix swapped lseek arguments.
jilles [Fri, 20 Jan 2012 16:29:17 +0000 (16:29 +0000)]
MFC r227124: fifo_misc test: Fix swapped lseek arguments.

It worked regardless because SEEK_CUR happens to be 1.

PR: misc/160866

git-svn-id: svn://svn.freebsd.org/base/stable/9@230384 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r227123: lint: Fix lseek() argument order.
jilles [Fri, 20 Jan 2012 15:43:08 +0000 (15:43 +0000)]
MFC r227123: lint: Fix lseek() argument order.

Because SEEK_SET is 0, this seems to have no effect on the generated code.

PR: bin/160806
Submitted by: Henning Petersen <henning dot petersen at t-online dot de>
Obtained from: NetBSD

git-svn-id: svn://svn.freebsd.org/base/stable/9@230381 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r229977
brueffer [Wed, 18 Jan 2012 21:59:32 +0000 (21:59 +0000)]
MFC: r229977

Add hpt27xx to the hardware notes,

While here, add the 2012 copyright.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230321 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: 229965
gnn [Wed, 18 Jan 2012 21:54:34 +0000 (21:54 +0000)]
MFC: 229965

Fix for PR 138526.

Add the ability for /dev/null and /dev/zero to accept
being set into non blocking mode via fcntl().  This
brings the code into compliance with IEEE Std 1003.1-2001
as referenced in another PR, 94729.

Reviewed by: jhb

git-svn-id: svn://svn.freebsd.org/base/stable/9@230320 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r229984
truckman [Wed, 18 Jan 2012 21:49:37 +0000 (21:49 +0000)]
MFC: r229984

Pass the arguments to mtx_init() in the correct order.  There should be
no change to the binary because the value of MTX_DEF is zero and there
is a visible function prototype.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230317 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r228869,r228874:
jhibbits [Wed, 18 Jan 2012 11:48:07 +0000 (11:48 +0000)]
MFC r228869,r228874:

Implement hwpmc counting PMC support for PowerPC G4+ (MPC745x/MPC744x).
Sampling is in progress.

Approved by: nwhitehorn (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@230305 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230032, r230050, r230090, r230091 and r228493.
hselasky [Wed, 18 Jan 2012 07:57:17 +0000 (07:57 +0000)]
MFC r230032, r230050, r230090, r230091 and r228493.
- Various XHCI and USB 3.0 related issues.
- USB 3.0 HUBs should work after this change.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230302 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229971:
kib [Wed, 18 Jan 2012 04:37:17 +0000 (04:37 +0000)]
MFC r229971:
Add PCI Id for the AMT SOL UART on 5 series Intel chipsets.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230298 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229495:
kib [Wed, 18 Jan 2012 04:34:18 +0000 (04:34 +0000)]
MFC r229495:
Do not restart the scan in vm_object_page_clean() on the object
generation change if requested mode is async.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230297 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r230035:
jhibbits [Tue, 17 Jan 2012 22:42:54 +0000 (22:42 +0000)]
MFC r230035:

Add PWM monitoring sysctl to G4 MDD (Windtunnel) fan driver.  While there, clean
up some style nits.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230290 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: Revert changes in r229899. The ypserv daemon could not work with multiple
hrs [Tue, 17 Jan 2012 20:56:12 +0000 (20:56 +0000)]
MFC: Revert changes in r229899.  The ypserv daemon could not work with multiple
socktypes due to it.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230280 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMerge r229085 from head:
gavin [Tue, 17 Jan 2012 13:52:04 +0000 (13:52 +0000)]
Merge r229085 from head:

  Default to not performing the early-boot memory tests when we detect we
  are booting inside a VM.  There are three reasons to disable this:

  o  It causes the VM host to believe that all the tested pages or RAM are
     in use.  This in turn may force the host to page out pages of RAM
     belonging to other VMs, or otherwise cause problems with fair resource
     sharing on the VM cluster.
  o  It adds significant time to the boot process (around 1 second/Gig in
     testing)
  o  It is unnecessary - the host should have already verified that the
     memory is functional etc.

  Note that this simply changes the default when in a VM - it can still be
  overridden using the hw.memtest.tests tunable.

Early MFC requested by: bz

git-svn-id: svn://svn.freebsd.org/base/stable/9@230266 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC: r228218, r228219, 228220, 228221
pho [Tue, 17 Jan 2012 11:04:58 +0000 (11:04 +0000)]
MFC: r228218, r228219, 228220, 228221

Rename copyin_timeout32 to umtx_copyin_timeout32 and move parameter
check here. Include check for negative seconds value.
Add umtx_copyin_timeout() and move parameter checks here.
Add declaration of umtx_copyin_timeout()
Use umtx_copyin_timeout() to copy and check timeout parameter.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230263 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229771:
kib [Tue, 17 Jan 2012 07:01:22 +0000 (07:01 +0000)]
MFC r229771:
Document comconsole_port and comconsole_pcidev loader variables.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230259 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229934:
kib [Tue, 17 Jan 2012 06:57:55 +0000 (06:57 +0000)]
MFC r229934:
Change the type of the paging_in_progress refcounter from u_short to
u_int. With the auto-sized buffer cache on the modern machines, UFS
metadata can generate more the 65535 pages belonging to the buffers
undergoing i/o, overflowing the counter.

To keep the layout of other fields of the struct vm_object intact
on stable/9, put enlarged paging_in_progress at the end of the structure,
and put a placeholder in the place of old pip counter.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230258 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoMFC r229435:
kib [Tue, 17 Jan 2012 06:40:41 +0000 (06:40 +0000)]
MFC r229435:
Add special loader environment variables 'comconsole_port' and
'comconsole_pcidev'.

Change allows to use ISA serial ports other than COM1 for the
loader/kernel console without loader recompilation, and to configure
console on the PCI-attached UARTs.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230257 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

12 years agoDocument the following open issues:
hrs [Tue, 17 Jan 2012 02:49:23 +0000 (02:49 +0000)]
Document the following open issues:

 - $ipv6_prefix_IF fails to configure IF when there is no $ifconfig_IF_ipv6.
 - USB 3.0 hubs do not work.

git-svn-id: svn://svn.freebsd.org/base/stable/9@230254 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f