]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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>

15 years agoDocument crcopysafe() and crsetgroups().
Brooks Davis [Fri, 19 Jun 2009 19:16:35 +0000 (19:16 +0000)]
Document crcopysafe() and crsetgroups().

Reminded by: julian

15 years agoRework the credential code to support larger values of NGROUPS and
Brooks Davis [Fri, 19 Jun 2009 17:10:35 +0000 (17:10 +0000)]
Rework the credential code to support larger values of NGROUPS and
NGROUPS_MAX, eliminate ABI dependencies on them, and raise the to 1024
and 1023 respectively.  (Previously they were equal, but under a close
reading of POSIX, NGROUPS_MAX was defined to be too large by 1 since it
is the number of supplemental groups, not total number of groups.)

The bulk of the change consists of converting the struct ucred member
cr_groups from a static array to a pointer.  Do the equivalent in
kinfo_proc.

Introduce new interfaces crcopysafe() and crsetgroups() for duplicating
a process credential before modifying it and for setting group lists
respectively.  Both interfaces take care for the details of allocating
groups array. crsetgroups() takes care of truncating the group list
to the current maximum (NGROUPS) if necessary.  In the future,
crsetgroups() may be responsible for insuring invariants such as sorting
the supplemental groups to allow groupmember() to be implemented as a
binary search.

Because we can not change struct xucred without breaking application
ABIs, we leave it alone and introduce a new XU_NGROUPS value which is
always 16 and is to be used or NGRPS as appropriate for things such as
NFS which need to use no more than 16 groups.  When feasible, truncate
the group list rather than generating an error.

Minor changes:
  - Reduce the number of hand rolled versions of groupmember().
  - Do not assign to both cr_gid and cr_groups[0].
  - Modify ipfw to cache ucreds instead of part of their contents since
    they are immutable once referenced by more than one entity.

Submitted by: Isilon Systems (initial implementation)
X-MFC after: never
PR: bin/113398 kern/133867

15 years agoWhen running pkg_add -r, check & install our dependencies for each
Brian Somers [Fri, 19 Jun 2009 17:07:38 +0000 (17:07 +0000)]
When running pkg_add -r, check & install our dependencies for each
package rather than expecting our top level package to get all of
the dependencies correct.

Previously, the code depended on the top level package having all
of the pkgdep lines in +CONTENTS correct and in the right order,
but that doesn't always happen due to code such as this (in
security/gnutls/Makefile):

    .if (defined(WITH_LZO) || exists(${LOCALBASE}/lib/liblzo2.so)) && !defined(WITHOUT_LZO)
    LIB_DEPENDS+=           lzo2:${PORTSDIR}/archivers/lzo2
    ....

With such conditional dependencies, my 'sophox-packages' package won't
install.  The dependency tree looks like this:

    sophox-packages
      ...
      x11/gnome2
        x11/gnome-applets
          net/libgweather
            devel/libsoup
              security/gnutls
                security/libgcrypt
                  security/libgpg-error
      ...
      x11/gnome2
        archivers/file-roller
          archivers/gtar
            archivers/lzop
              archivers/lzo2
      ...

gnutls doesn't depend on lzo2 initially, but lzo2 is dragged into the
mix via other dependencies and is built by the initial 'make'.  The
subsequent package generation for gnutls adds a pkgdep line for lzo2
to gnutls' +CONTENTS but the pkgdeps in sophox-packages' +CONTENTS
has gnutls *before* lzo2.

As a result, sophox-packages cannot install; gnutls fails because lzo2
is missing, 82 more packages fail because gnutls is missing and the
whole thing spirals into a super-confusing mess!

MFC after: 3 weeks

15 years agoIn preparation for raising NGROUPS and NGROUPS_MAX, change base
Brooks Davis [Fri, 19 Jun 2009 15:58:24 +0000 (15:58 +0000)]
In preparation for raising NGROUPS and NGROUPS_MAX, change base
system callers of getgroups(), getgrouplist(), and setgroups() to
allocate buffers dynamically.  Specifically, allocate a buffer of size
sysconf(_SC_NGROUPS_MAX)+1 (+2 in a few cases to allow for overflow).

This (or similar gymnastics) is required for the code to actually follow
the POSIX.1-2008 specification where {NGROUPS_MAX} may differ at runtime
and where getgroups may return {NGROUPS_MAX}+1 results on systems like
FreeBSD which include the primary group.

In id(1), don't pointlessly add the primary group to the list of all
groups, it is always the first result from getgroups().  In principle
the old code was more portable, but this was only done in one of the two
places where getgroups() was called to the overall effect was pointless.

Document the actual POSIX requirements in the getgroups(2) and
setgroups(2) manpages.  We do not yet support a dynamic NGROUPS, but we
may in the future.

MFC after: 2 weeks

15 years agoWhen checking if we can write to a file, use access() instead of a
Brooks Davis [Fri, 19 Jun 2009 15:52:35 +0000 (15:52 +0000)]
When checking if we can write to a file, use access() instead of a
manual permission check based on stat output.  Also, get rid of the
executability check since it is not used.

MFC after: 2 weeks

15 years agoMFV of r194480
Edwin Groothuis [Fri, 19 Jun 2009 11:52:07 +0000 (11:52 +0000)]
MFV of r194480

- Official start of Bangladesh DST.

15 years agoVendor import of tzdata2009j
Edwin Groothuis [Fri, 19 Jun 2009 11:23:10 +0000 (11:23 +0000)]
Vendor import of tzdata2009j

- Official start of Bangladesh DST start.

Obtained from: ftp://elsie.nci.nih.gov/pub/

15 years agoThe "original" PR said that there were two issues with the motd
Edwin Groothuis [Fri, 19 Jun 2009 07:18:45 +0000 (07:18 +0000)]
The "original" PR said that there were two issues with the motd
(Eyes of the daemon not synced and the motd not displayed properly
on black-on-white screens): The first one was not valid anymore
since the text and logo were swapped already, the second one is
fixed by resetting the whole colourscheme instead of only the
background colour.

(also removed svn:keywords from motd since it doesn't have the
 string $FreeBSD$ in it)

PR: misc/15876
Submitted by: peter.jeremy@ALCATEL.COM.AU
MFC after: 1 week

15 years agoieee80211_dwds_mcast(): check the correct mbuf ptr after encap.
Rui Paulo [Thu, 18 Jun 2009 21:15:41 +0000 (21:15 +0000)]
ieee80211_dwds_mcast(): check the correct mbuf ptr after encap.

15 years agoFix a deadlock in the getpeername() method for UNIX domain sockets.
John Baldwin [Thu, 18 Jun 2009 20:56:22 +0000 (20:56 +0000)]
Fix a deadlock in the getpeername() method for UNIX domain sockets.
Instead of locking the local unp followed by the remote unp, use the same
locking model as accept() and read lock the global link lock followed by
the remote unp while fetching the remote sockaddr.

Reported by: Mel Flynn  mel.flynn of mailing.thruhere.net
Reviewed by: rwatson
MFC after: 1 week

15 years agoTrack the kernel mapping of a physical page by a new entry in vm_page
Andrew Thompson [Thu, 18 Jun 2009 20:42:37 +0000 (20:42 +0000)]
Track the kernel mapping of a physical page by a new entry in vm_page
structure. When the page is shared, the kernel mapping becomes a special
type of managed page to force the cache off the page mappings. This is
needed to avoid stale entries on all ARM VIVT caches, and VIPT caches
with cache color issue.

Submitted by: Mark Tinguely
Reviewed by: alc
Tested by: Grzegorz Bernacki, thompsa

15 years agoUtilize the new function kmem_alloc_contig() to implement the UMA back-end
Alan Cox [Thu, 18 Jun 2009 17:59:04 +0000 (17:59 +0000)]
Utilize the new function kmem_alloc_contig() to implement the UMA back-end
allocator for the jumbo frames zones.  This change has two benefits: (1) a
custom back-end deallocator is no longer required.  UMA's standard
deallocator suffices. (2) It eliminates a potentially confusing artifact
of using contigmalloc(): The malloc(9) statistics contain bogus information
about the usage of jumbo frames.  Specifically, the malloc(9) statistics
report all jumbo frames in use whereas the UMA zone statistics report the
"truth" about the number in use vs. the number free.

15 years agoRe-do r192913 in less intrusive way. Only do IP_RECVDSTADDR/IP_SENDSRCADDR
Alexander Kabaev [Thu, 18 Jun 2009 17:10:43 +0000 (17:10 +0000)]
Re-do r192913 in less intrusive way. Only do IP_RECVDSTADDR/IP_SENDSRCADDR
dace for UPDv4 sockets bound to INADDR_ANY. Move the code to set
IP_RECVDSTADDR/IP_SENDSRCADDR into svc_dg.c, so that both TLI and non-TLI
users will be using it.

Back out my previous commit to mountd. Turns out the problem was affecting
more than one binary so it needs to me addressed in generic rpc code in
libc in order to fix them all.

Reported by: lstewart
Tested by: lstewart

15 years agoSince the width is always 2, it is enough to put just one
Hajimu UMEMOTO [Thu, 18 Jun 2009 16:40:00 +0000 (16:40 +0000)]
Since the width is always 2, it is enough to put just one
trailing space is enough.

MFC after: 1 week

15 years ago- Don't hard code _.disk.full. Use the variable.
Nick Hibma [Thu, 18 Jun 2009 13:56:10 +0000 (13:56 +0000)]
- Don't hard code _.disk.full. Use the variable.
- _.bk should be created in MAKEOBJDIRPREFIX as well
- Remove a misplaced and unnecessary message.

15 years agoReverse some stuff I accidentally committed in the previous commit:
Nick Hibma [Thu, 18 Jun 2009 11:35:29 +0000 (11:35 +0000)]
Reverse some stuff I accidentally committed in the previous commit:

- creation of sparse files to speed up the build process. This was
  discussed with phk 2 years ago and he disagreed with this change.
- handling of negative data partition sizes.

Can I have the ... green pointy hat, please?

15 years agoFix tabs, slightly improve comments.
Ivan Voras [Thu, 18 Jun 2009 11:12:11 +0000 (11:12 +0000)]
Fix tabs, slightly improve comments.

Approved by: gnn (mentor) (original)
Noticed by: stas

15 years agoReplace use of ic->ic_flags with vap->iv_flags to operate on per-vap flags
Coleman Kane [Thu, 18 Jun 2009 11:12:10 +0000 (11:12 +0000)]
Replace use of ic->ic_flags with vap->iv_flags to operate on per-vap flags
for ndis 802.11 work.

Submitted by: Paul B. Mahol <onemda@gmail.com>

15 years agoAllow building world into a separate dir (for reuse in multiple images):
Nick Hibma [Thu, 18 Jun 2009 10:39:08 +0000 (10:39 +0000)]
Allow building world into a separate dir (for reuse in multiple images):
- buildworld and buildkernel are built into MAKEOBJDIRPREFIX
- installworld and installkernel are performed on NANO_OBJ.

No change of functionality if MAKEOBJDIRPREFIX is not set. If it is sea,t
clean_world deletes NANO_OBJ instead of NANO_WORLDDIR. By starting nanobsd.sh
with the -b option the existing world can be reused to build a new world
reducing time and disk space considerably.

While there:
- Fix two cases where (in comments) MAKEOBJDIRPREFIX should have been
  NANO_DISKIMGDIR.
- Simplify an 'if (not wrong); then true; else action; fi' into
  'if wrong; then action; fi'. 'if ! false; then echo hello; fi' produces hello.

Note: Make sure you use NANO_OBJ were you use MAKEOBJDIRPREFIX now in your
nanobsd.conf files if you want to split out.

15 years agoAdd support for UMA_SLAB_KERNEL to page_free(). (While I'm here remove an
Alan Cox [Thu, 18 Jun 2009 07:27:11 +0000 (07:27 +0000)]
Add support for UMA_SLAB_KERNEL to page_free().  (While I'm here remove an
unnecessary newline character from the end of two panic messages.)

15 years agoFix some of the style errors in *getpages().
Alan Cox [Thu, 18 Jun 2009 05:56:24 +0000 (05:56 +0000)]
Fix some of the style errors in *getpages().

15 years agoAdd the SVC_RELEASE(xprt), as required by r194407.
Rick Macklem [Wed, 17 Jun 2009 22:55:59 +0000 (22:55 +0000)]
Add the SVC_RELEASE(xprt), as required by r194407.

Approved by: kib (mentor)

15 years agoSince svc_[dg|vc|tli|tp]_create() did not hold a reference count on the
Rick Macklem [Wed, 17 Jun 2009 22:50:26 +0000 (22:50 +0000)]
Since svc_[dg|vc|tli|tp]_create() did not hold a reference count on the
SVCXPTR structure returned by them, it was possible for the structure
to be free'd before svc_reg() had been completed using the structure.
This patch acquires a reference count on the newly created structure
that is returned by svc_[dg|vc|tli|tp]_create(). It also
adds the appropriate SVC_RELEASE() calls to the callers, except the
experimental nfs subsystem. The latter will be committed separately.

Submitted by: dfr
Tested by: pho
Approved by: kib (mentor)

15 years agoProperly flush input after an error in backquotes in interactive mode.
Jilles Tjoelker [Wed, 17 Jun 2009 21:58:32 +0000 (21:58 +0000)]
Properly flush input after an error in backquotes in interactive mode.

For parsing an old-style backquote substitution (`...`),
a string "file" is used to store the contents of the
substitution (with the special backslash processing done).
If an error occurs, the shell cleans up all these files
(returning to the top level) and flush the top level
file. Erroneously, it first flushed the current file and
then cleaned up all extra files, so that the top level
file (i.e. the terminal) was not flushed.

Example (in interactive mode):
  echo `for` echo This should not be printed

Also noticeable in (in interactive mode):
  echo `(`
The old version prints an extraneous prompt.

Approved by: ed (mentor)

15 years agoEliminate unnecessary forward declarations.
Alan Cox [Wed, 17 Jun 2009 20:12:23 +0000 (20:12 +0000)]
Eliminate unnecessary forward declarations.

15 years agoRegen.
John Baldwin [Wed, 17 Jun 2009 19:53:47 +0000 (19:53 +0000)]
Regen.

15 years agoRegen for added flags field.
John Baldwin [Wed, 17 Jun 2009 19:53:20 +0000 (19:53 +0000)]
Regen for added flags field.

15 years ago- Add the ability to mix multiple flags seperated by pipe ('|') characters
John Baldwin [Wed, 17 Jun 2009 19:50:38 +0000 (19:50 +0000)]
- Add the ability to mix multiple flags seperated by pipe ('|') characters
  in the type field of system call tables.  Specifically, one can now use
  the 'NO*' types as flags in addition to the 'COMPAT*' types.  For example,
  to tag 'COMPAT*' system calls as living in a KLD via NOSTD.  The COMPAT*
  type is required to be listed first in this case.
- Add new functions 'type()' and 'flag()' to the embedded awk script in
  makesyscalls.sh that return true if a requested flag is found in the
  type field ($3).  The flag() function checks all of the flags in the
  field, but type() only checks the first flag.  type() is meant to be
  used in the top-level "switch" statement and flag() should be used
  otherwise.
- Retire the CPT_NOA type, it is now replaced with "COMPAT|NOARGS" using
  the flags approach.
- Tweak the comment descriptions of COMPAT[46] system calls so that they
  say "freebsd[46] foo" rather than "old foo".
- Document the COMPAT6 type.
- Sync comments in compat32 syscall table with the master table.

15 years agoKeep dirhash tailq locked throughout the entirety of ufsdirhash_destroy() to fix
Sean Nicholas Barkas [Wed, 17 Jun 2009 18:55:29 +0000 (18:55 +0000)]
Keep dirhash tailq locked throughout the entirety of ufsdirhash_destroy() to fix
a potential race pointed out by pjd. Also use TAILQ_FOREACH_SAFE to iterate over
dirhashes in ufsdirhash_lowmem(), so that we can continue iterating even after a
dirhash is destroyed.

Suggested by: pjd
Tested by:      pho
Approved by: dwmalone (mentor)

15 years agoRetire the unused stub for the nfsclnt() system call.
John Baldwin [Wed, 17 Jun 2009 18:52:42 +0000 (18:52 +0000)]
Retire the unused stub for the nfsclnt() system call.

15 years agoRemove the now-unused NOIMPL flag. It serves no useful purpose given the
John Baldwin [Wed, 17 Jun 2009 18:46:14 +0000 (18:46 +0000)]
Remove the now-unused NOIMPL flag.  It serves no useful purpose given the
existing UNIMPL and NOSTD types.

15 years ago- NOSTD results in lkmressys being used instead of lkmssys.
John Baldwin [Wed, 17 Jun 2009 18:44:15 +0000 (18:44 +0000)]
- NOSTD results in lkmressys being used instead of lkmssys.
- Mark nfsclnt as UNIMPL.  It should have been NOSTD instead of NOIMPL back
  when it lived in nfsclient.ko, but it was removed from that a long time
  ago.

15 years agoupdate usb config; the old stack is gone
Sam Leffler [Wed, 17 Jun 2009 17:59:36 +0000 (17:59 +0000)]
update usb config; the old stack is gone

15 years agoenable npe-a now that it works
Sam Leffler [Wed, 17 Jun 2009 17:58:18 +0000 (17:58 +0000)]
enable npe-a now that it works

15 years agoAdd workaround to get IXP435 NPE-A working: reseting NPE-A after NPE-C
Sam Leffler [Wed, 17 Jun 2009 17:57:52 +0000 (17:57 +0000)]
Add workaround to get IXP435 NPE-A working: reseting NPE-A after NPE-C
causes both to become inoperative; this apparently was done by the original
IAL code as a workaround for IMEM parity errors which we've not seen so
just disable the reset.

Note this problem does not occur on IXP425 boards. The linux driver does
fuse-resets on each NPE but in the order NPE-A < NPE-B < NPE-C (when probing
for which NPE's are present/operational); we may want to switch to a similar
scheme but for now disable the resets until we see an issue.

15 years agoRefactor contigmalloc() into two functions: a simple front-end that deals
Alan Cox [Wed, 17 Jun 2009 17:19:48 +0000 (17:19 +0000)]
Refactor contigmalloc() into two functions: a simple front-end that deals
with the malloc tag and calls a new back-end, kmem_alloc_contig(), that
allocates the pages and maps them.

The motivations for this change are two-fold: (1) A cache mode parameter
will be added to kmem_alloc_contig().  In other words, kmem_alloc_contig()
will be extended to support the allocation of memory with caller-specified
caching. (2) The UMA allocation function that is used by the two jumbo
frames zones can use kmem_alloc_contig() in place of contigmalloc() and
thereby avoid having free jumbo frames held by the zone counted as live
malloc()ed memory.

15 years agoTeach cpu_est_clockrate() about the G5's slightly different PMC. This
Nathan Whitehorn [Wed, 17 Jun 2009 16:34:40 +0000 (16:34 +0000)]
Teach cpu_est_clockrate() about the G5's slightly different PMC. This
allows the boot messages to include the CPU speed and makes possible
the forthcoming cpufreq support for the PPC 970.

15 years agoAdd explicit includes for jail.h to the files that need them and
Bjoern A. Zeeb [Wed, 17 Jun 2009 15:01:01 +0000 (15:01 +0000)]
Add explicit includes for jail.h to the files that need them and
remove the "hidden" one from vimage.h.

15 years agoFix column width of weekday names for multibyte locales.
Hajimu UMEMOTO [Wed, 17 Jun 2009 14:47:06 +0000 (14:47 +0000)]
Fix column width of weekday names for multibyte locales.

Noticed by: nyan
Discussed with: matusita, takawata
MFC after: 1 week

15 years agoUse the right jail parameters for -v (cpuset has changed to cpuset.id).
Jamie Gritton [Wed, 17 Jun 2009 14:32:08 +0000 (14:32 +0000)]
Use the right jail parameters for -v (cpuset has changed to cpuset.id).

Reported by: netchild
Approved by: bz (mentor)

15 years agoFix handling of ".." in nfs_lookup() for the forced dismount case
Rick Macklem [Wed, 17 Jun 2009 14:10:18 +0000 (14:10 +0000)]
Fix handling of ".." in nfs_lookup() for the forced dismount case
by cribbing the change made to the regular nfs client in r194358.

Approved by: kib (mentor)

15 years agoFor dotdot lookup in nfs_lookup, inline the vn_vget_ino() to prevent
Konstantin Belousov [Wed, 17 Jun 2009 12:47:27 +0000 (12:47 +0000)]
For dotdot lookup in nfs_lookup, inline the vn_vget_ino() to prevent
operating on the unmounted mount point and freed mount data in case of
forced unmount performed while dvp is unlocked to nget the target vnode.

Add missed calls to m_freem(mrep) there on error exits [1].

Submitted by: rmacklem [1]
Tested by: pho
MFC after: 2 weeks

15 years agoAdd the explicit include of vimage.h to another five .c files still
Bjoern A. Zeeb [Wed, 17 Jun 2009 12:44:11 +0000 (12:44 +0000)]
Add the explicit include of vimage.h to another five .c files still
missing it.

Remove the "hidden" kernel only include of vimage.h from ip_var.h added
with the very first Vimage commit r181803 to avoid further kernel poisoning.

15 years agoDecrement state->ls_threads when vnode appeared to be doomed.
Konstantin Belousov [Wed, 17 Jun 2009 12:43:04 +0000 (12:43 +0000)]
Decrement state->ls_threads when vnode appeared to be doomed.

Reported and tested by: pho

15 years agoChanges to the NR-Sack code so that:
Randall Stewart [Wed, 17 Jun 2009 12:34:56 +0000 (12:34 +0000)]
Changes to the NR-Sack code so that:
1) All bit disappears
2) The two sets of gaps (nr and non-nr) are
   disjointed, you don't have gaps struck in
   both places.

This adjusts us to coorespond to the new draft. Still
to-do, cleanup the code so that there are only one set
of sack routines (original NR-Sack done by E cloned all
sack code).

15 years agoAdd a .cvsignore file and along with that put an svn:ignore proprty
Bjoern A. Zeeb [Wed, 17 Jun 2009 10:48:32 +0000 (10:48 +0000)]
Add a .cvsignore file and along with that put an svn:ignore proprty
on the directory like we have for all other target architectures.

Discussed with: imp (kind of)

15 years agoMake compile again using proper protoypes for
Bjoern A. Zeeb [Wed, 17 Jun 2009 10:26:37 +0000 (10:26 +0000)]
Make compile again using proper protoypes for
pcib_read/write_config DEVMETHOD.