]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoRegen.
John Baldwin [Mon, 22 Jun 2009 20:24:03 +0000 (20:24 +0000)]
Regen.

15 years agoInclude definitions for the audit identifiers for compat system calls in
John Baldwin [Mon, 22 Jun 2009 20:14:10 +0000 (20:14 +0000)]
Include definitions for the audit identifiers for compat system calls in
sysproto.h.  This makes it possible to use SYSCALL_MODULE() for compat
system calls that live in kernel modules.

15 years agoFix a typo in a comment.
John Baldwin [Mon, 22 Jun 2009 20:12:40 +0000 (20:12 +0000)]
Fix a typo in a comment.

15 years agoEnable MSI in the MSI capability registers any time that the first message
John Baldwin [Mon, 22 Jun 2009 20:08:06 +0000 (20:08 +0000)]
Enable MSI in the MSI capability registers any time that the first message
in an MSI group is enabled, not just if the address/data pair are not
initialized.

Reported by: rnoland
MFC after: 1 week

15 years agoUpdate m_demote:
Andre Oppermann [Mon, 22 Jun 2009 19:35:39 +0000 (19:35 +0000)]
Update m_demote:
- remove HT_HEADER test (MT_HEADER == MT_DATA for some time now)
- be more pedantic about m_nextpkt in other than first mbuf
- update m_flags to be retained

15 years agoValidate the page in one place, dev_pager_getpages(), rather than doing it
Alan Cox [Mon, 22 Jun 2009 19:09:48 +0000 (19:09 +0000)]
Validate the page in one place, dev_pager_getpages(), rather than doing it
in two places, dev_pager_getfake() and dev_pager_updatefake().

Compare a pointer to "NULL" rather than "0".

15 years agoUpdates after r194640:
Bjoern A. Zeeb [Mon, 22 Jun 2009 17:56:07 +0000 (17:56 +0000)]
Updates after r194640:
- shrink size guards for vnet_net.
  vnet_rtable does not need size guards as it is self-contained.
- remove a bunch of defines from vnet.h no longer valid.

15 years agoMove virtualization of routing related variables into their own
Bjoern A. Zeeb [Mon, 22 Jun 2009 17:48:16 +0000 (17:48 +0000)]
Move virtualization of routing related variables into their own
Vimage module, which had been there already but now is stateful.

All variables are now file local; so this further limits the global
spreading of routing related things throughout the kernel.

Add a missing function local variable in case of MPATHing.

Reviewed by: zec

15 years agoAdd a missing return in NULL mutex case.
Jung-uk Kim [Mon, 22 Jun 2009 17:46:55 +0000 (17:46 +0000)]
Add a missing return in NULL mutex case.

Submitted by: Pawel Worach (pawel dot worach at gmail dot com)

15 years agoSplit tolower/toupper code from usual xlat16 kiconv table, and make it
Xin LI [Mon, 22 Jun 2009 17:09:46 +0000 (17:09 +0000)]
Split tolower/toupper code from usual xlat16 kiconv table, and make it
possible to do tolower/toupper independently without code conversion.

Submitted by: imura (but bugs are mine)
Obtained from: http://people.freebsd.org/~imura/kiconv/
(1_kiconv_wctype_kern.diff, 1_kiconv_wctype_user.diff)

15 years agoAdd prototypes when the library is compiled static.
Xin LI [Mon, 22 Jun 2009 17:00:20 +0000 (17:00 +0000)]
Add prototypes when the library is compiled static.

15 years agofix wrong name for the iso!
Luigi Rizzo [Mon, 22 Jun 2009 16:06:38 +0000 (16:06 +0000)]
fix wrong name for the iso!

15 years agoBump PowerPC loader(8) version to reflect extensions it has recently grown.
Rafal Jaworowski [Mon, 22 Jun 2009 15:57:12 +0000 (15:57 +0000)]
Bump PowerPC loader(8) version to reflect extensions it has recently grown.

15 years agoKeep file list sorted.
Rafal Jaworowski [Mon, 22 Jun 2009 15:53:41 +0000 (15:53 +0000)]
Keep file list sorted.

15 years agoDS1553 RTC module driver. On the MPC8555CDS system it hangs off of the LBC bus.
Rafal Jaworowski [Mon, 22 Jun 2009 15:48:47 +0000 (15:48 +0000)]
DS1553 RTC module driver. On the MPC8555CDS system it hangs off of the LBC bus.

Obtained from: Semihalf

15 years agoAdd code to generate a bootable ISO image, so we are finally
Luigi Rizzo [Mon, 22 Jun 2009 15:45:26 +0000 (15:45 +0000)]
Add code to generate a bootable ISO image, so we are finally
free from the 2.88MB that we had using El Torito emulation.

The --iso option was already there, just didn't do anything before.

Submitted by: Marta Carbone
MFC after: 3 days

15 years agoIntegrated I2C controller driver (found in MPC85xx and other SOC parts).
Rafal Jaworowski [Mon, 22 Jun 2009 15:34:32 +0000 (15:34 +0000)]
Integrated I2C controller driver (found in MPC85xx and other SOC parts).

Obtained from: Freescale, Semihalf

15 years agoCollect all VIMAGE_GLOBALS variables in one place.
Bjoern A. Zeeb [Mon, 22 Jun 2009 15:07:12 +0000 (15:07 +0000)]
Collect all VIMAGE_GLOBALS variables in one place.

No longer export rt_tables as all lookups go through
rt_tables_get_rnh().

We cannot make rt_tables (and rtstat, rttrash[1]) static as
netstat -r (-rs[1]) would stop working on a stripped
VIMAGE_GLOBALS kernel.

Reviewed by: zec
Presumably broken by: phk 13.5y ago in r12820 [1]

15 years ago- Fall-back to /etc/termcap.small if there is no /usr/share/misc/termcap
Rong-En Fan [Mon, 22 Jun 2009 15:00:15 +0000 (15:00 +0000)]
- Fall-back to /etc/termcap.small if there is no /usr/share/misc/termcap
  (i.e. /etc/termcap). This can be useful when using /rescue/vi while /usr
  is not (or unable to be) mounted. The termcap.small can be found in
  src/etc/termcap.small.

PR: bin/80256 (audit-trail)
Submitted by: Brian Candler <B.Candler at pobox.com>, Alex Kozlov <spam at rm-rf.kiev.ua>
MFC after: 1 month

15 years agoChange cam_periph_ioctl() to take 'cmd' and a u_long instead of an
Scott Long [Mon, 22 Jun 2009 14:43:48 +0000 (14:43 +0000)]
Change cam_periph_ioctl() to take 'cmd' and a u_long instead of an
int.  All of its callers pass in cmd as a u_long, so this has
always been a dangerous type demotion.  It was spooted by clang/llvm
trying to do a type promotion and sign extension within
cam_periph_ioctl.

Submitted by: rdivacky

15 years agoAdd a new function, ifa_ifwithaddr_check(), which rather than returning
Robert Watson [Mon, 22 Jun 2009 10:59:34 +0000 (10:59 +0000)]
Add a new function, ifa_ifwithaddr_check(), which rather than returning
a pointer to an ifaddr matching the passed socket address, returns a
boolean indicating whether one was present.  In the (near) future,
ifa_ifwithaddr() will return a referenced ifaddr rather than a raw
ifaddr pointer, and the new wrapper will allow callers that care only
about the boolean condition to avoid having to free that reference.

MFC after: 3 weeks

15 years agoRemove unneeded stores back into the function arguments.
Ed Schouten [Mon, 22 Jun 2009 10:56:08 +0000 (10:56 +0000)]
Remove unneeded stores back into the function arguments.

Submitted by: Christoph Mallon

15 years agoAfter the update to fxp(4) in r194573 we should no longer need
Bjoern A. Zeeb [Mon, 22 Jun 2009 10:27:20 +0000 (10:27 +0000)]
After the update to fxp(4) in r194573 we should no longer need
this DELAY(100) hack introduced in r56938.

Thanks to: yongari
MFC after: 6 weeks
X-MFC note: not before the fxp(4) changes

15 years agoAdd a global rwlock, at_ifaddr_rw, to protect the global netatalk
Robert Watson [Mon, 22 Jun 2009 10:23:54 +0000 (10:23 +0000)]
Add a global rwlock, at_ifaddr_rw, to protect the global netatalk
address lists, at_ifaddr_list.  Acquire the lock, and use ifaddr
refcounts where necessary, to close most known address-related
races in netatalk.

Annotate one potential race in at_control() where we acquire an
ifaddr reference, drop the global lock, and scrub the address from
the ifnet before re-acquiring the global lock, which could allow
for a writer-writer race.

MFC after: 3 weeks

15 years agoMove definitions of AT_* constants from the middle of the open(2) flags
Konstantin Belousov [Mon, 22 Jun 2009 10:11:35 +0000 (10:11 +0000)]
Move definitions of AT_* constants from the middle of the open(2) flags
enumeration.

Noted by: bde

15 years agoO_NOFOLLOW shall be in flags, not in cmode.
Konstantin Belousov [Mon, 22 Jun 2009 10:08:48 +0000 (10:08 +0000)]
O_NOFOLLOW shall be in flags, not in cmode.

Noted by: bde

15 years agoRemove a hack from r186086 so that IPsec via loopback routes continued
Bjoern A. Zeeb [Mon, 22 Jun 2009 09:24:46 +0000 (09:24 +0000)]
Remove a hack from r186086 so that IPsec via loopback routes continued
working. It was targeted for stable/7 compatibility and actually never
did anything in HEAD.

Reminded by: rwatson
X-MFC after: never

15 years agoEliminate dead code. These definitions should have been deleted with the
Alan Cox [Mon, 22 Jun 2009 04:21:02 +0000 (04:21 +0000)]
Eliminate dead code.  These definitions should have been deleted with the
introduction of i686_mem.c in r45405.

Merge adjacent #ifdef _KERNEL/#endif blocks.

15 years agoAdd ipx_ifaddr locking to ipx_control(), which should close most
Robert Watson [Sun, 21 Jun 2009 21:42:29 +0000 (21:42 +0000)]
Add ipx_ifaddr locking to ipx_control(), which should close most
remaining potential races in ifconfig's management of IPX addresses.

This is largely accomplished by dropping a global write lock for the
IPX address list over the body of in_control(), although there are
some places we bump the refcount on an ifaddr of interest while
calling out to the routing code or link layer code, which might
require revisiting.

Annotate one as a potential race if two simultaneous delete ioctls
are issued for the same IPX addresses at once.

MFC after: 3 weeks

15 years agoDisable write-back until I figure out what's wrong with it on the i81342.
Olivier Houchard [Sun, 21 Jun 2009 21:38:12 +0000 (21:38 +0000)]
Disable write-back until I figure out what's wrong with it on the i81342.
There's no need to disable the MMU once we're done inflating the kernel.

15 years agoIntroduce basic locking of global IPX address list 'ipx_ifaddr' using
Robert Watson [Sun, 21 Jun 2009 21:04:12 +0000 (21:04 +0000)]
Introduce basic locking of global IPX address list 'ipx_ifaddr' using
a new rwlock, ipx_ifaddr_rw, wrapped with macros.  This locking is
necessary but not sufficient, in isolation, to satisfy the stability
requirements of a fully parallel IPX input path during interface
reconfiguration.

MFC after: 3 weeks

15 years agoImplement a mechanism within vm_phys_alloc_contig() to defer all necessary
Alan Cox [Sun, 21 Jun 2009 20:29:14 +0000 (20:29 +0000)]
Implement a mechanism within vm_phys_alloc_contig() to defer all necessary
calls to vdrop() until after the free page queues lock is released.  This
eliminates repeatedly releasing and reacquiring the free page queues lock
each time the last cached page is reclaimed from a vnode-backed object.

15 years agoIn ipx_control(), lock if_addr_mtx when adding/removing addresses from
Robert Watson [Sun, 21 Jun 2009 20:08:07 +0000 (20:08 +0000)]
In ipx_control(), lock if_addr_mtx when adding/removing addresses from
interface address lists, and don't add an address until it's fully
initialized.

MFC after: 3 weeks

15 years agoClean up common ifaddr management:
Robert Watson [Sun, 21 Jun 2009 19:30:33 +0000 (19:30 +0000)]
Clean up common ifaddr management:

- Unify reference count and lock initialization in a single function,
  ifa_init().
- Move tear-down from a macro (IFAFREE) to a function ifa_free().
- Move reference count bump from a macro (IFAREF) to a function ifa_ref().
- Instead of using a u_int protected by a mutex to refcount(9) for
  reference count management.

The ifa_mtx is now used for exactly one ioctl, and possibly should be
removed.

MFC after: 3 weeks

15 years agoAdd explicit struct ucred * argument for VOP_VPTOCNP, to be used by
Konstantin Belousov [Sun, 21 Jun 2009 19:21:01 +0000 (19:21 +0000)]
Add explicit struct ucred * argument for VOP_VPTOCNP, to be used by
vn_open_cred in default implementation. Valid struct ucred is needed for
audit and MAC, and curthread credentials may be wrong.

This further requires modifying the interface of vn_fullpath(9), but it
is out of scope of this change.

Reviewed by: rwatson

15 years agoadd %b formats for various registers
Sam Leffler [Sun, 21 Jun 2009 19:17:22 +0000 (19:17 +0000)]
add %b formats for various registers

15 years agoMinor style cleanups.
Robert Watson [Sun, 21 Jun 2009 16:56:49 +0000 (16:56 +0000)]
Minor style cleanups.

MFC after: 3 days

15 years agoRemove unuxed ipx_zerohost.
Robert Watson [Sun, 21 Jun 2009 16:11:40 +0000 (16:11 +0000)]
Remove unuxed ipx_zerohost.

MFC after: 3 days

15 years agoUpdate copyright on netipx.
Robert Watson [Sun, 21 Jun 2009 16:11:26 +0000 (16:11 +0000)]
Update copyright on netipx.

15 years agoAdd another flags argument to vn_open_cred. Use it to specify that some
Konstantin Belousov [Sun, 21 Jun 2009 13:41:32 +0000 (13:41 +0000)]
Add another flags argument to vn_open_cred. Use it to specify that some
vn_open_cred invocations shall not audit namei path.

In particular, specify VN_OPEN_NOAUDIT for dotdot lookup performed by
default implementation of vop_vptocnp, and for the open done for core
file. vn_fullpath is called from the audit code, and vn_open there need
to disable audit to avoid infinite recursion. Core file is created on
return to user mode, that, in particular, happens during syscall return.
The creation of the core file is audited by direct calls, and we do not
want to overwrite audit information for syscall.

Reported, reviewed and tested by: rwatson

15 years ago- Eliminate extra subcs instruction. I have not noticed before that we
Stanislav Sedov [Sun, 21 Jun 2009 13:15:56 +0000 (13:15 +0000)]
- Eliminate extra subcs instruction.  I have not noticed before that we
  always perform substraction now, so no instruction could be rordered
  to eliminate the conditional substraction.

15 years agouse PROTO_DEFAULT.
Remko Lodder [Sun, 21 Jun 2009 13:13:13 +0000 (13:13 +0000)]
use PROTO_DEFAULT.

Requested by: hps

15 years ago- Fix strncmp on arm. Return 0 as result without performing the
Stanislav Sedov [Sun, 21 Jun 2009 12:58:56 +0000 (12:58 +0000)]
- Fix strncmp on arm. Return 0 as result without performing the
  main cycle only if the len passed is equal to 0. If end address
  overflows use last possible address as the end address.

Based on: discussion on arm@
MFC after: 1 month

15 years agoAdd support for the Myson Heden 8813.
Remko Lodder [Sun, 21 Jun 2009 11:21:16 +0000 (11:21 +0000)]
Add support for the Myson Heden 8813.
Note that I also added the usbdev to the list, because the 8813 version
is not yet known there. I might have twisted the sorting there but because
8813 comes before 8818, I added it before that (with _8813 to differentiate)
the item.

PR: 135628
Submitted by: Yoshikazu GOTO <goto at on-link dot jp>
Approved by: imp (mentor, implicit)

15 years agoSwitch cmd argument to u_long. This matches what if_ethersubr.c does and
Roman Divacky [Sun, 21 Jun 2009 10:29:31 +0000 (10:29 +0000)]
Switch cmd argument to u_long. This matches what if_ethersubr.c does and
allows the code to compile cleanly on amd64 with clang.

Reviewed by: rwatson
Approved by: ed (mentor)

15 years agoRemove historical support for capturing IPX packets in the output path
Robert Watson [Sun, 21 Jun 2009 10:10:44 +0000 (10:10 +0000)]
Remove historical support for capturing IPX packets in the output path
using raw IPX sockets.  While functional, this support is disabled
using a flag that can't be changed from userspace, and google reveals
no documentation or use of that flag anywhere.  This eliminates a
potential lock order reversal and code reentrance issue in which the
output path reentered the input path in IPX.

An alternative to removal would be to use the netisr, as a comment I
added in 2005 suggests.  While this change is fairly straight-forward,
the lack of any consumers or the easy possibility of consumers (kernel
modification and recompile required) suggests that this is simply an
unused feature.

Update README to remove this TODO, and a TODO regarding IPX/IP
encapsulation which was also removed a few years ago.

MFC after: 1 week

15 years agoAdd support for uncompressing pack(1)'ed files. Pack(1) is a program found
Xin LI [Sun, 21 Jun 2009 09:39:43 +0000 (09:39 +0000)]
Add support for uncompressing pack(1)'ed files.  Pack(1) is a program found
in some commercial Unix systems, which utilizes Huffman minimum redundancy
code tree to compress files.  This implementation supports the "new" pack
format only, just like GNU gzip did.

Thanks for oliver@'s archive set which I can test against, and Mingyan Guo
for providing helpful review of my code.

PR: bin/109567
MFC after: 1 month

15 years agoIn non-debugging mode make this define (void)0 instead of nothing. This
Roman Divacky [Sun, 21 Jun 2009 09:01:12 +0000 (09:01 +0000)]
In non-debugging mode make this define (void)0 instead of nothing. This
helps to catch bugs like the below with clang.

if (cond); <--- note the trailing ;
   something();

Approved by: ed (mentor)
Discussed on: current@

15 years agoIn non-debugging mode make this define (void)0 instead of nothing. This
Roman Divacky [Sun, 21 Jun 2009 08:49:06 +0000 (08:49 +0000)]
In non-debugging mode make this define (void)0 instead of nothing. This
helps to catch bugs like the below with clang.

if (cond); <--- note the trailing ;
   something();

Approved by: ed (mentor)
Discussed on: current@

15 years agoIn non-debugging mode make this define (void)0 instead of nothing. This
Roman Divacky [Sun, 21 Jun 2009 08:36:30 +0000 (08:36 +0000)]
In non-debugging mode make this define (void)0 instead of nothing. This
helps to catch bugs like the below with clang.

if (cond); <--- note the trailing ;
   something();

Approved by: ed (mentor)
Discussed on: current@

15 years agoIn non-debugging mode make this define (void)0 instead of nothing. This
Roman Divacky [Sun, 21 Jun 2009 07:54:47 +0000 (07:54 +0000)]
In non-debugging mode make this define (void)0 instead of nothing. This
helps to catch bugs like the below with clang.

if (cond); <--- note the trailing ;
   something();

Approved by: ed (mentor)
Discussed on: current@

15 years agoFor ICH based fxp(4) controllers treat them as 82559 compatibles.
Pyun YongHyeon [Sun, 21 Jun 2009 07:34:12 +0000 (07:34 +0000)]
For ICH based fxp(4) controllers treat them as 82559 compatibles.
To detect which controller is ICH based one, add a new member
variable ich to struct fxp_ident and move the struct to
if_fxpvar.h. Since I've faked controller revision, don't allow
microcode loading for ICH based controllers.
With this change all ICH based controllers will have WOL and Rx
checksum offload capability.

PR: kern/135451
Tested by: Alexey Shuvaev ( shuvaev <> physik dot uni-wuerzburg dot de ),
pluknet ( pluknet <> gmail dot com ),
Gary Jennejohn ( gary.jennejohn <> freenet dot de )

15 years agoOverhaul fxp(4) multicast filter programming. fxp(4) hardwares do
Pyun YongHyeon [Sun, 21 Jun 2009 07:17:49 +0000 (07:17 +0000)]
Overhaul fxp(4) multicast filter programming. fxp(4) hardwares do
not allow multicast filter programming when controller is busy to
send/receive frames. So it used to mark need_mcsetup bit and defer
multicast filter programming until controller becomes idle state.
To detect when the controller is idle fxp(4) relied on Tx
completion interrupt with NOP command and fxp_start_body and
fxp_intr_body had to see whether pending multicast filter
programming was requested. This resulted in very complex logic and
sometimes it did not work as expected.
Since the controller should be in idle state before any multicast
filter modifications I changed it to reinitialize the controller
whenever multicast filter programming is required. This is the same
way what OpenBSD and NetBSD does. Also I added IFF_DRV_RUNNING
check in ioctl handler so controller would be reinitialized only if
it is absolutely needed.
With this change I guess we can remove fxp(4) DELAY hack in ifioctl
for IPv6 case.

15 years agoAlways check fxp(4) is running, see if it can accept frames from
Pyun YongHyeon [Sun, 21 Jun 2009 06:46:32 +0000 (06:46 +0000)]
Always check fxp(4) is running, see if it can accept frames from
upper stack in fxp_start_body().
fxp(4) drops driver lock in Rx path so check the fxp(4) is still
running after reacquiring driver lock in Rx path. Also don't
invoke fxp_intr_body if fxp(4) is not running. With this change
there is no need to set suspend bit in device attach phase.

15 years agoDon't blindly enable Rx lock-up workaround. Newer chips do not need
Pyun YongHyeon [Sun, 21 Jun 2009 06:27:35 +0000 (06:27 +0000)]
Don't blindly enable Rx lock-up workaround. Newer chips do not need
the Rx lock-up workaround.

Obtained from: NetBSD

15 years agoDue to possible PCI bus lock-up issues fxp(4) didn't perform full
Pyun YongHyeon [Sun, 21 Jun 2009 06:18:19 +0000 (06:18 +0000)]
Due to possible PCI bus lock-up issues fxp(4) didn't perform full
hardware reset in attach phase. Selective reset does not clear
configured parameters so I think full hardware reset is required.
To prevent PCI bus lock-up, do selective reset first which will get
off the controller from PCI bus and request software reset after
selective reset. Software reset will unmask interrupts so disable
it after the reset.

15 years agoIntroduce Rx mbuf dma tag and use it in Rx path. Previously it used
Pyun YongHyeon [Sun, 21 Jun 2009 06:06:43 +0000 (06:06 +0000)]
Introduce Rx mbuf dma tag and use it in Rx path. Previously it used
common mbuf dma tag for both Tx and Rx path but Rx buffer should
have single DMA segment and maximum buffer size of the segment
should be less than MCLBYTES.
fxp(4) also have to check Tx completion status which was updated by
DMA so we need BUS_DMASYNC_PREREAD and BUS_DMASYNC_POSTWRITE
synchronization in Tx path. Fix all misuse of bus_dmamap_sync(9) in
fxp(4). I guess this change shall fix occasional driver breakage in
PAE environments.

While I'm here add error messages of dma tag/buffer creation and
correct messages.

15 years agoCompile static gcov library with -fPIC to match what stock GCC builds
Alexander Kabaev [Sun, 21 Jun 2009 01:54:47 +0000 (01:54 +0000)]
Compile static gcov library with -fPIC to match what stock GCC builds
are doing. This is required for libgcov.a to be usable on amd64.

Reported by: stas

15 years agofix !x86 cxgb compile
Kip Macy [Sun, 21 Jun 2009 01:17:38 +0000 (01:17 +0000)]
fix !x86 cxgb compile

15 years agoStrive for greater consistency among the places that implement real,
Alan Cox [Sun, 21 Jun 2009 00:21:33 +0000 (00:21 +0000)]
Strive for greater consistency among the places that implement real,
fictious, and contiguous page allocation.  Eliminate unnecessary
reinitialization of a page's fields.

15 years agoImplement socket delivery MAC checks for IPX/SPX.
Robert Watson [Sat, 20 Jun 2009 23:38:21 +0000 (23:38 +0000)]
Implement socket delivery MAC checks for IPX/SPX.

Obtained from: TrustedBSD Project
MFC after: 3 days

15 years agoFix race condition in noclobber option.
Jilles Tjoelker [Sat, 20 Jun 2009 20:44:27 +0000 (20:44 +0000)]
Fix race condition in noclobber option.

Formerly, it was possible for the file to be created between the check if it
existed and the open; the contents would then be lost.

Because this must use O_EXCL, noclobber > will not create a file through a
symlink anymore. This agrees with behaviour of other shells.

Approved by: ed (mentor) (implicit)

15 years agoAdd architecture support for TinyBSD
Remko Lodder [Sat, 20 Jun 2009 20:35:50 +0000 (20:35 +0000)]
Add architecture support for TinyBSD

PR: 135301
Submitted by: Olivier Cochard-Labbe <olivier at cochard dot me>
Reviewed by: Jean Milanez Melo <jmelo at freebsdbrasil dot com dot br> (maintainer)
Approved by: imp (mentor, implicit)
MFC after: 1 week

15 years agoChange crsetgroups_locked() (called by crsetgroups()) to sort the
Brooks Davis [Sat, 20 Jun 2009 20:29:21 +0000 (20:29 +0000)]
Change crsetgroups_locked() (called by crsetgroups()) to sort the
supplemental groups using insertion sort.  Use this property in
groupmember() to let us use a binary search instead of the previous
linear search.

15 years agoIf the label being printed by getpmac(8) is empty, then don't print a
Robert Watson [Sat, 20 Jun 2009 20:22:11 +0000 (20:22 +0000)]
If the label being printed by getpmac(8) is empty, then don't print a
carriage return.

Obtained from: TrustedBSD Project
MFC after: 3 days

15 years agofix typo in conditional
Kip Macy [Sat, 20 Jun 2009 19:09:41 +0000 (19:09 +0000)]
fix typo in conditional

15 years ago- fix dma map handling for !x86 case
Kip Macy [Sat, 20 Jun 2009 18:57:14 +0000 (18:57 +0000)]
- fix dma map handling for !x86 case
- fix allocation failure handing in refill_fl

15 years agoUse NGROUPS instead of NGROUPS_MAX as the limits on setgroups and
Brooks Davis [Sat, 20 Jun 2009 18:52:02 +0000 (18:52 +0000)]
Use NGROUPS instead of NGROUPS_MAX as the limits on setgroups and
getgroups for ibcs emulation.  It seems vanishingly likely any
programs will actually be affected since they probably assume a much
lower value and use a static array size.

15 years agoRemove definition of dtom(), which converted a data pointer into a
Robert Watson [Sat, 20 Jun 2009 18:27:19 +0000 (18:27 +0000)]
Remove definition of dtom(), which converted a data pointer into a
pointer to the containing mbuf.  This eliminates a strong assumption
about the layout of network buffer memory, giving us greater
flexibility to revise mbuf semantics in the future.

15 years agoRestore the check against running as root that I accidentally removed in
Brooks Davis [Sat, 20 Jun 2009 18:24:29 +0000 (18:24 +0000)]
Restore the check against running as root that I accidentally removed in
r194493.

15 years agoRework SPX segment reassembly, which was originally based on our TCP
Robert Watson [Sat, 20 Jun 2009 18:24:25 +0000 (18:24 +0000)]
Rework SPX segment reassembly, which was originally based on our TCP
reassembly but failed to be modernized over time:

- Use queue(9).
- Specifically allocate queue entries of type M_SPXREASSQ to point at
  member mbufs, rather than casting mbuf data to 'spx_q'.
- Maintain the mbuf pointer as part of the queue entry so that we can
  later free the mbuf without using dtom().

15 years agoUp the scale of the SPX loopback check a bit: use much larger data sizes
Robert Watson [Sat, 20 Jun 2009 18:13:20 +0000 (18:13 +0000)]
Up the scale of the SPX loopback check a bit: use much larger data sizes
so that we need to do segmentation.

15 years agoInvoke the MAC Framework's mac_socket_create_mbuf() entry point when
Robert Watson [Sat, 20 Jun 2009 17:44:04 +0000 (17:44 +0000)]
Invoke the MAC Framework's mac_socket_create_mbuf() entry point when
generating IPX output for SPX sockets.

Obtained from: TrustedBSD Project

15 years agoInvoke the MAC Framework's mac_socket_create_mbuf() entry point when
Robert Watson [Sat, 20 Jun 2009 17:42:53 +0000 (17:42 +0000)]
Invoke the MAC Framework's mac_socket_create_mbuf() entry point when
generating IPX output for raw and datagram IPX sockets.

Obtained from: TrustedBSD Project

15 years agoDon't lock sockets around calls to mac_socket_create_mbuf() -- policies
Robert Watson [Sat, 20 Jun 2009 17:28:38 +0000 (17:28 +0000)]
Don't lock sockets around calls to mac_socket_create_mbuf() -- policies
are now expected to acquire the socket lock if they require them.

Obtained from: TrustedBSD Project

15 years agoDelete the declaration of an unused variable so that it will build.
Rick Macklem [Sat, 20 Jun 2009 17:16:29 +0000 (17:16 +0000)]
Delete the declaration of an unused variable so that it will build.

Approved by: rwatson (mentor)

15 years agoReplace RPCAUTH_UNIXGIDS with NFS_MAXGRPS so that nfscbd.c will build.
Rick Macklem [Sat, 20 Jun 2009 17:11:07 +0000 (17:11 +0000)]
Replace RPCAUTH_UNIXGIDS with NFS_MAXGRPS so that nfscbd.c will build.

Approved by: kib (mentor)

15 years agoThe G45 docs indicate that all G4X chips use the new framecount register.
Robert Noland [Sat, 20 Jun 2009 16:45:14 +0000 (16:45 +0000)]
The G45 docs indicate that all G4X chips use the new framecount register.

Intel agrees with my reading of the docs, make it so for all G4X chips.

The new register also has a 32 bit width as opposed to 24 bits.  Fix
things up so that the counters roll over properly.

MFC after: 3 days

15 years agorealloc() behaves identically to malloc when passed a NULL object pointer
Robert Noland [Sat, 20 Jun 2009 16:40:48 +0000 (16:40 +0000)]
realloc() behaves identically to malloc when passed a NULL object pointer

If an error does occur we would have left max_context with an incorrect
value.

MFC after: 3 days

15 years agoAdd placeholder to prevent reuse of privilege 254.
Ed Schouten [Sat, 20 Jun 2009 16:39:25 +0000 (16:39 +0000)]
Add placeholder to prevent reuse of privilege 254.

Requested by: rwatson

15 years agoDon't panic if drm_rmmap is called with a NULL map pointer.
Robert Noland [Sat, 20 Jun 2009 16:37:24 +0000 (16:37 +0000)]
Don't panic if drm_rmmap is called with a NULL map pointer.

MFC after: 3 days

15 years agoImprove sentence and add reference to openpty(3). Add missing newlines.
Ed Schouten [Sat, 20 Jun 2009 16:30:32 +0000 (16:30 +0000)]
Improve sentence and add reference to openpty(3). Add missing newlines.

15 years agoChase the removal of PRIV_TTY_PRISON in the mac(9) modules.
Ed Schouten [Sat, 20 Jun 2009 15:54:35 +0000 (15:54 +0000)]
Chase the removal of PRIV_TTY_PRISON in the mac(9) modules.

Reported by: kib
Pointy hat to: me

15 years agoImprove nested jail awareness of devfs by handling credentials.
Ed Schouten [Sat, 20 Jun 2009 14:50:32 +0000 (14:50 +0000)]
Improve nested jail awareness of devfs by handling credentials.

Now that we start to use credentials on character devices more often
(because of MPSAFE TTY), move the prison-checks that are in place in the
TTY code into devfs.

Instead of strictly comparing the prisons, use the more common
prison_check() function to compare credentials. This means that
pseudo-terminals are only visible in devfs by processes within the same
jail and parent jails.

Even though regular users in parent jails can now interact with
pseudo-terminals from child jails, this seems to be the right approach.
These processes are also capable of interacting with the jailed
processes anyway, through signals for example.

Reviewed by: kib, rwatson (older version)

15 years agoAllow order of initialization of loaded shared objects to be
Alexander Kabaev [Sat, 20 Jun 2009 14:16:41 +0000 (14:16 +0000)]
Allow order of initialization of loaded shared objects to be
altered through their .init code. This might happen if init
vector calls dlopen on its own and that dlopen causes some not
yet initialized object to be initialized earlier as part of that
dlopened DAG.

Do not reset module reference counts to zero on final fini vector
run when process is exiting. Just add an additional parameter to
force fini vector invocation regardless of current reference count
value if object was not destructed yet. This allows dlclose called
from fini vector to proceed normally instead of failing with handle
validation error.

Reviewed by: kib
Reported by: venki kaps

15 years agoRewrap; this was getting painful. Translators can ignore this.
Dag-Erling Smørgrav [Sat, 20 Jun 2009 10:09:59 +0000 (10:09 +0000)]
Rewrap; this was getting painful.  Translators can ignore this.

MFC after: 1 week

15 years agoReword.
Dag-Erling Smørgrav [Sat, 20 Jun 2009 10:06:10 +0000 (10:06 +0000)]
Reword.

MFC after: 1 week

15 years ago- Include rpcv2.h before other NFS includes. That allows nfscbd to
Stanislav Sedov [Sat, 20 Jun 2009 08:46:40 +0000 (08:46 +0000)]
- Include rpcv2.h before other NFS includes. That allows nfscbd to
  compile.

15 years agoFix "tar --options=iso9660:joliet" and other uses
Tim Kientzle [Sat, 20 Jun 2009 06:02:21 +0000 (06:02 +0000)]
Fix "tar --options=iso9660:joliet" and other uses
of format-specific options.

15 years agoDrop the high FP state of an exiting thread in cpu_thread_exit() and
Marcel Moolenaar [Sat, 20 Jun 2009 05:36:53 +0000 (05:36 +0000)]
Drop the high FP state of an exiting thread in cpu_thread_exit() and
not in cpu_exit(). The latter is called after td_md.md_highfp_mtx
has been destroyed, which results in a race condition when another
thread wants to use the high FP registers on the CPU that still has
the high FP registers in question.

15 years agoChange the size of the nfsc_groups[] array in the experimental nfs
Rick Macklem [Sat, 20 Jun 2009 00:54:57 +0000 (00:54 +0000)]
Change the size of the nfsc_groups[] array in the experimental nfs
client to RPCAUTH_UNIXGIDS + 1 (17), since that is what can go on
the wire for AUTH_SYS authentication.

Reviewed by: brooks
Approved by: kib (mentor)

15 years agoMake puc(4) aware of this 2 port serial card based on NetMos 9835:
Navdeep Parhar [Sat, 20 Jun 2009 00:04:48 +0000 (00:04 +0000)]
Make puc(4) aware of this 2 port serial card based on NetMos 9835:

puc0@pci0:4:1:0:       class=0x070002 card=0x00021000 chip=0x98359710 rev=0x01 hdr=0x00

Reviewed by: marcel@
Approved by: gnn (mentor)

15 years agoGreatly simplify cxgb by removing almost all of the custom mbuf management logic
Kip Macy [Fri, 19 Jun 2009 23:34:32 +0000 (23:34 +0000)]
Greatly simplify cxgb by removing almost all of the custom mbuf management logic

- remove mbuf iovec - useful, but adds too much complexity when isolated to
   the driver

- remove driver private caching - insufficient benefit over UMA to justify
  the added complexity and maintenance overhead

- remove separate logic for managing multiple transmit queues, with the
  new drbr routines the control flow can be made to much more closely resemble
  legacy drivers

- remove dedicated service threads, with per-cpu callouts one can get the same
  benefit much more simply by registering a callout 1 tick in the future if there
  are still buffered packets

- remove embedded mbuf usage - Jeffr's changes will (I hope) soon be integrated
  greatly reducing the overhead of using kernel APIs for reference counting
  clusters

- add hysteresis to descriptor coalescing logic

- add coalesce threshold sysctls to allow users to decide at run-time
  between optimizing for forwarding / UDP or optimizing for TCP

- add once per second watchdog to effectively close the very rare races
  occurring from coalescing

- incorporate Navdeep's changes to the initialization path required to
  convert port and adapter locks back to ordinary mutexes (silencing BPF
  LOR complaints)

- enable prefetches in get_packet and tx cleaning

Reviewed by: navdeep@
MFC after: 2 weeks

15 years agoadd helper function for flushing software queues
Kip Macy [Fri, 19 Jun 2009 23:11:20 +0000 (23:11 +0000)]
add helper function for flushing software queues

15 years agoAdd tests for r194406 and r194516.
Jilles Tjoelker [Fri, 19 Jun 2009 22:15:59 +0000 (22:15 +0000)]
Add tests for r194406 and r194516.

Approved by: ed (mentor)

15 years agoFix some issues with quoted output and shorten it in some cases.
Jilles Tjoelker [Fri, 19 Jun 2009 22:09:55 +0000 (22:09 +0000)]
Fix some issues with quoted output and shorten it in some cases.

Output quoted suitable for re-input to the shell occurs in
various cases such as 'set', 'trap'.

Bugfix: *, ? and [ must be quoted (except sole [)
Bugfix: ~ and # must be quoted (really only sometimes, but keep it simple)
Bugfix: space, tab and newline must always be quoted
Shortening: other IFS characters do not need quoting
Bugfix: send to correct output file, not hard-coded stdout
Shortening: avoid unnecessary '' with \'

Approved by: ed (mentor)

15 years agodefine helper routines for deferred mbuf initialization
Kip Macy [Fri, 19 Jun 2009 21:14:39 +0000 (21:14 +0000)]
define helper routines for deferred mbuf initialization

15 years agoMove setting of ports from NAT-T below key_getsah() and actually
Bjoern A. Zeeb [Fri, 19 Jun 2009 21:01:55 +0000 (21:01 +0000)]
Move setting of ports from NAT-T below key_getsah() and actually
below key_setsaval().
Without that, the lookup for the SA had failed as we were looking for
a SA with the new, updated port numbers instead of the old ones and
were comparing the ports in key_cmpsaidx().
This makes updating the remote -> local SA on the initiator work again.

Problem introduced with: p4 changeset 152114

15 years agoImplement the -z (zero counters) option for the various bpf counters.
Christian S.J. Peron [Fri, 19 Jun 2009 20:31:44 +0000 (20:31 +0000)]
Implement the -z (zero counters) option for the various bpf counters.
Add necessary changes to the kernel for this (basically introduce a
bpf_zero_counters() function).  As well, update the man page.

MFC after: 1 month
Discussed with: rwatson

15 years agoTwo fixes for SMALL case when compiling with WARNS=6:
Xin LI [Fri, 19 Jun 2009 19:28:21 +0000 (19:28 +0000)]
Two fixes for SMALL case when compiling with WARNS=6:

 - Reduce scope where return value can be referenced.
 - Add a dummy access to timestamp to silence warning.

Submitted by: Mingyan Guo <guomingyan gmail com>