]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoIFC at r232948
flo [Wed, 14 Mar 2012 00:41:37 +0000 (00:41 +0000)]
IFC at r232948

Approved by: attilio

12 years agoSupply boolean as the second argument to ffs_update(), and not a
kib [Tue, 13 Mar 2012 22:04:27 +0000 (22:04 +0000)]
Supply boolean as the second argument to ffs_update(), and not a
MNT_[NO]WAIT constants, which in fact always caused sync operation.

Based on the submission by: bde
Reviewed by: mckusick
MFC after: 2 weeks

12 years agoLock the process around manipulations with p_flag.
kib [Tue, 13 Mar 2012 22:00:46 +0000 (22:00 +0000)]
Lock the process around manipulations with p_flag.

Reported and reviewed by: jh
MFC after: 3 days

12 years agoUpdate the rt2860's firmware and add a Makefile for the module. While
bschmidt [Tue, 13 Mar 2012 21:25:25 +0000 (21:25 +0000)]
Update the rt2860's firmware and add a Makefile for the module. While
here remove the ucode header file which was used to generate the fw files
but by now is outdated.

Reviewed by: ray
Obtained from: OpenBSD

12 years agoAdd a BINDIR so "make install" works.
adrian [Tue, 13 Mar 2012 20:30:23 +0000 (20:30 +0000)]
Add a BINDIR so "make install" works.

12 years ago(Re)-make these ACL routines optional.
adrian [Tue, 13 Mar 2012 20:29:56 +0000 (20:29 +0000)]
(Re)-make these ACL routines optional.

They're only currently used by ZFS and UFS_ACL.  They're just wasting space
on embedded platforms with neither enabled.

12 years agoAdd dependencies onto acl_posix1e and acl_nfs4.
adrian [Tue, 13 Mar 2012 20:29:04 +0000 (20:29 +0000)]
Add dependencies onto acl_posix1e and acl_nfs4.

12 years agoAdd module building Makefile entries for NFSv4 and POSIX.1e ACL handling.
adrian [Tue, 13 Mar 2012 20:28:42 +0000 (20:28 +0000)]
Add module building Makefile entries for NFSv4 and POSIX.1e ACL handling.

12 years agoAdd module load/unload stubs.
adrian [Tue, 13 Mar 2012 20:27:48 +0000 (20:27 +0000)]
Add module load/unload stubs.

12 years agoFirst set of xlocale man pages. More to follow...
theraven [Tue, 13 Mar 2012 20:02:41 +0000 (20:02 +0000)]
First set of xlocale man pages.  More to follow...

Approved by: dim (mentor)

12 years agoPull in a fix (still under GPLv2) for a double free in gdb, leading to
dim [Tue, 13 Mar 2012 19:40:56 +0000 (19:40 +0000)]
Pull in a fix (still under GPLv2) for a double free in gdb, leading to
an assert, which can occur if you repeatedly dlopen() and dlclose() a
.so file in a tight loop.  This was reported on freebsd-current@ by
Alexandre Martins, with a sample to reproduce the behaviour.

Obtained from: http://sourceware.org/git/?p=gdb.git;a=commit;h=a6f2cbb341520f8e100f4b8305979dd6207a79e8

12 years agoUpdate comments and CFLAGS in sys/conf/kern.mk, introduced in r221879,
dim [Tue, 13 Mar 2012 19:18:34 +0000 (19:18 +0000)]
Update comments and CFLAGS in sys/conf/kern.mk, introduced in r221879,
to match reality: clang does _not_ disable SSE automatically when
-mno-mmx is used, you have to specify -mno-sse explicitly.

Note this was the case even before r232894, which only makes a change in
the 'positive' flag case; e.g. when you specify -msse, MMX gets enabled
too.

MFC after: 1 week

12 years agoWork around a binutils bug on powerpc64 where the TOC would not be
nwhitehorn [Tue, 13 Mar 2012 18:59:19 +0000 (18:59 +0000)]
Work around a binutils bug on powerpc64 where the TOC would not be
properly reloaded when calling _fini() in large binaries with multiple
TOC sections (e.g. GCC), leading to a segmentation fault. Adding -mlongcall
to crt1 flags causes the compiler to emit explicit TOC load instructions
for all function calls, including _fini().

Reviewed by: kib
Pointy hat to: kib

12 years agoAnd remove the duplicate inlines...
theraven [Tue, 13 Mar 2012 18:53:28 +0000 (18:53 +0000)]
And remove the duplicate inlines...

Approved by: dim (mentor)

12 years agoFix the other missing prototypes.
theraven [Tue, 13 Mar 2012 17:32:55 +0000 (17:32 +0000)]
Fix the other missing prototypes.

Approved by: dim (mentor)

12 years agoAdd missing prototypes.
theraven [Tue, 13 Mar 2012 15:21:14 +0000 (15:21 +0000)]
Add missing prototypes.

Approved by: dim (mentor)

12 years agoMore xlocale cleanups.
theraven [Tue, 13 Mar 2012 14:14:13 +0000 (14:14 +0000)]
More xlocale cleanups.

Approved by: dim (mentor)

12 years agoUse rt_numfibs variable instead of compile-time RT_NUMFIBS.
melifaro [Tue, 13 Mar 2012 11:08:40 +0000 (11:08 +0000)]
Use rt_numfibs variable instead of compile-time RT_NUMFIBS.

Reviewed by:    glebius (previous version)
Approved by:    kib(mentor), ae(mentor)

12 years agoSome formatting for r232919.
mav [Tue, 13 Mar 2012 10:54:14 +0000 (10:54 +0000)]
Some formatting for r232919.

Submitted by: pluknet

12 years agoAdd kern.eventtimer.activetick tunable/sysctl, specifying whether each
mav [Tue, 13 Mar 2012 10:21:08 +0000 (10:21 +0000)]
Add kern.eventtimer.activetick tunable/sysctl, specifying whether each
hardclock() tick should be run on every active CPU, or on only one.

On my tests, avoiding extra interrupts because of this on 8-CPU Core i7
system with HZ=10000 saves about 2% of performance. At this moment option
implemented only for global timers, as reprogramming per-CPU timers is
too expensive now to be compensated by this benefit, especially since we
still have to regularly run hardclock() on at least one active CPU to
update system uptime. For global timer it is quite trivial: timer runs
always, but we just skip IPIs to other CPUs when possible.

Option is enabled by default now, keeping previous behavior, as periodic
hardclock() calls are still used at least to implement setitimer(2) with
ITIMER_VIRTUAL and ITIMER_PROF arguments. But since default schedulers don't
depend on it since r232917, we are much more free to experiment with it.

MFC after: 1 month

12 years agoUse NULL instead of 0
kevlo [Tue, 13 Mar 2012 10:04:13 +0000 (10:04 +0000)]
Use NULL instead of 0

12 years agoRewrite thread CPU usage percentage math to not depend on periodic calls
mav [Tue, 13 Mar 2012 08:18:54 +0000 (08:18 +0000)]
Rewrite thread CPU usage percentage math to not depend on periodic calls
with HZ rate through the sched_tick() calls from hardclock().

Potentially it can be used to improve precision, but now it is just minus
one more reason to call hardclock() for every HZ tick on every active CPU.
SCHED_4BSD never used sched_tick(), but keep it in place for now, as at
least SCHED_FBFS existing in patches out of the tree depends on it.

MFC after: 1 month

12 years agoRemove a now unneeded ARGE_UNLOCK().
adrian [Tue, 13 Mar 2012 06:50:56 +0000 (06:50 +0000)]
Remove a now unneeded ARGE_UNLOCK().

Whilst I'm here, remove a couple blank lines.

12 years agoRemove some files not used by the FreeBSD kernel which have been adding quite
jmallett [Tue, 13 Mar 2012 06:48:26 +0000 (06:48 +0000)]
Remove some files not used by the FreeBSD kernel which have been adding quite
a bit of bloat to the kernel source tree's size.

12 years agoFix link status handling on if_arge upon system boot to allow bootp/NFS to
adrian [Tue, 13 Mar 2012 06:28:52 +0000 (06:28 +0000)]
Fix link status handling on if_arge upon system boot to allow bootp/NFS to
function.

From the submitter:

This patch fixes an issue I encountered using an NFS root with an
ar71xx-based MikroTik RouterBoard 450G on -current where the kernel fails
to contact a DHCP/BOOTP server via if_arge when it otherwise should be able
to.  This may be the same issue that Monthadar Al Jaberi reported against
an RSPRO on 6 March, as the signature is the same:

%%%

DHCP/BOOTP timeout for server 255.255.255.255
DHCP/BOOTP timeout for server 255.255.255.255
DHCP/BOOTP timeout for server 255.255.255.255
.
.
.
DHCP/BOOTP timeout for server 255.255.255.255
DHCP/BOOTP timeout for server 255.255.255.255
arge0: initialization failed: no memory for rx buffers
DHCP/BOOTP timeout for server 255.255.255.255
arge0: initialization failed: no memory for rx buffers

%%%

The primary issue that I found is that the DHCP/BOOTP message that
bootpc_call() is sending never makes it onto the wire, which I believe is
due to the following:

- Last December, a change was made to the ifioctl that bootpc_call() uses
to adjust the netmask around the sosend().

- The new ioctl (SIOCAIFADDR) performs an if_init when invoked, whereas the
old one (SIOCSIFNETMASK) did not.

- if_arge maintains its own sense of link state in sc->arge_link_status.

- On a single-phy interface, sc->arge_link_status is initialized to 0 in
arge_init_locked().

- sc->arge_link_status remains 0 until a phy state change notification
causes arge_link_task to run, notice the link is up, and set it to 1.

- The inits caused by the ifioctls in bootpc_call are reinitializing the
interface, but not the phy, so sc->arge_link_status goes to 0 and remains
there.

- arge_start_locked() always sees sc->arge_link_status == 0 and returns
without queuing anything.

The attached patch changes arge_init_locked() such that in the single-phy
case, instead of initializing sc->arge_link_status to 0, it runs
arge_link_task() to set it according to the current phy state.  This change
has allowed my setup to mount an NFS root successfully.

Submitted by: Patrick Kelsey <kelsey@ieee.org>
Reviewed by: juli

12 years agoDon't build kernel.tramp on Octeon. Probably building it should be opt-in
jmallett [Tue, 13 Mar 2012 06:22:49 +0000 (06:22 +0000)]
Don't build kernel.tramp on Octeon.  Probably building it should be opt-in
not opt-out, but I don't know enough about which ports need it to get the
defaults right.

12 years agoCorrectly (I hope) deallocate the if_arge RX buffer ring on arge_stop().
adrian [Tue, 13 Mar 2012 06:15:20 +0000 (06:15 +0000)]
Correctly (I hope) deallocate the if_arge RX buffer ring on arge_stop().

I had some interesting hangs until I realised I should try flushing the
DDR FIFO register and lo and behold, hangs stopped occuring.

I've put in a few DDR flushes here and there in case people decide to
reuse some of these functions.  It's very very likely they're almost
all superflous.

To test:

* Connect to a network with a _lot_ of broadcast traffic
* Do this:
  # while true; do ifconfig arge0 down; ifconfig arge0 up; done

This fixes the mbuf exhaustion that has been reported when the interface
state flaps up/down.

12 years agoFix crunchide on MIPS with other than the O32 ABI.
jmallett [Tue, 13 Mar 2012 05:21:14 +0000 (05:21 +0000)]
Fix crunchide on MIPS with other than the O32 ABI.

12 years agoNote two shortcomings of GDB on MIPS that should be addressed.
jmallett [Tue, 13 Mar 2012 04:50:41 +0000 (04:50 +0000)]
Note two shortcomings of GDB on MIPS that should be addressed.

12 years agosysinstall was removed from usr.sbin/Makefile in r225937. Because per-arch
jmallett [Tue, 13 Mar 2012 00:45:27 +0000 (00:45 +0000)]
sysinstall was removed from usr.sbin/Makefile in r225937.  Because per-arch
Makefiles were split out in this directory and others in userland, it makes it
quite easy to miss per-arch conditionals when changing something generally.

12 years agoAdd a kernel-toolchains target like the toolchains target, but building only
jmallett [Tue, 13 Mar 2012 00:38:49 +0000 (00:38 +0000)]
Add a kernel-toolchains target like the toolchains target, but building only
the parts of the toolchain necessary to build kernels.

12 years agoUse gpart "-a" flag to 4k alignment.
jpaetzel [Mon, 12 Mar 2012 21:41:29 +0000 (21:41 +0000)]
Use gpart "-a" flag to 4k alignment.

Submitted by: kris
Obtained from: PC-BSD

12 years agoAdd the ability to use a varity of ZFS dataset options.
jpaetzel [Mon, 12 Mar 2012 21:32:43 +0000 (21:32 +0000)]
Add the ability to use a varity of ZFS dataset options.
While here fix a bug causing zpools with /tmp mount-points to fail

Submitted by: kris
Obtained from: PC-BSD

12 years agoImprove ZFS exporting functionality, only export pools which are on a
jpaetzel [Mon, 12 Mar 2012 21:28:54 +0000 (21:28 +0000)]
Improve ZFS exporting functionality, only export pools which are on a
specific device we happen to be writing to. This fixes an issue when
running pc-sysinstall on a running system which needs ZFS and the main
disk gets exported.

Submitted by: kris
Obtained from: PC-BSD

12 years agoRemove TARGET_BIG_ENDIAN which should have been removed previously.
jmallett [Mon, 12 Mar 2012 21:26:09 +0000 (21:26 +0000)]
Remove TARGET_BIG_ENDIAN which should have been removed previously.

12 years agoo) Use ABI, not ISA_* options, to determine whether to compile bits if libkern
jmallett [Mon, 12 Mar 2012 21:25:32 +0000 (21:25 +0000)]
o) Use ABI, not ISA_* options, to determine whether to compile bits if libkern
   required for the ABI the kernel is being built for.
   XXX This is implemented in a kind-of nasty way that involves including source
       files, but it's still an improvement.
o) Retire ISA_* options since they're unused and were always wrong.

12 years agoCheck for intel RAID devices
jpaetzel [Mon, 12 Mar 2012 21:24:40 +0000 (21:24 +0000)]
Check for intel RAID devices

Submitted by: kris
Obtained from: PC-BSD

12 years agoPull in r145194 from upstream clang trunk:
dim [Mon, 12 Mar 2012 21:07:22 +0000 (21:07 +0000)]
Pull in r145194 from upstream clang trunk:

  Make our handling of MMX x SSE closer to what gcc does:

  * Enabling sse enables mmx.
  * Disabling (-mno-mmx) mmx, doesn't disable sse (we got this right already).
  * The order in not important. -msse -mno-mmx is the same as -mno-mmx -msse.

Some configure scripts depend on this.

PR: i386/165968
MFC after: 3 days

12 years agoUse PTR_SUBU instead of subu (missed this one)
gonzo [Mon, 12 Mar 2012 20:59:18 +0000 (20:59 +0000)]
Use PTR_SUBU instead of subu (missed this one)

12 years agoUse PTR_(ADD|SUB)U macrosses instead of hardcoded addu/subu
gonzo [Mon, 12 Mar 2012 20:58:09 +0000 (20:58 +0000)]
Use PTR_(ADD|SUB)U macrosses instead of hardcoded addu/subu

Spotted by: juli

12 years agoFix a couple of bugs saving network config.
jpaetzel [Mon, 12 Mar 2012 20:44:44 +0000 (20:44 +0000)]
Fix a couple of bugs saving network config.
Don't duplicate wlans_ lines.
Enable ipv6 on wireless devices correctly.

Submitted by: kris
Obtained from: PC-BSD

12 years agoMake sure when creating new MBR partition it is set to active by default.
jpaetzel [Mon, 12 Mar 2012 20:41:36 +0000 (20:41 +0000)]
Make sure when creating new MBR partition it is set to active by default.

Submitted by: kris
Obtained from: PC-BSD

12 years agoConfiguration changes/updates!
adrian [Mon, 12 Mar 2012 20:32:23 +0000 (20:32 +0000)]
Configuration changes/updates!

* enable ALQ and net80211/ath ALQ logging by default, to make it possible
  to get debug register traces.
* Update some comments
* Enable HWPMC for testing.

12 years agoRemove a stale comment.
scottl [Mon, 12 Mar 2012 20:31:58 +0000 (20:31 +0000)]
Remove a stale comment.

Submitted by: jimharris

12 years ago- Although we pass first 4 arguments in registers, function callinf ABI requires
gonzo [Mon, 12 Mar 2012 20:24:59 +0000 (20:24 +0000)]
- Although we pass first 4 arguments in registers, function callinf ABI requires
   space to be reserved for them in stack. _rtld() prologue saves a1 and a2 in
   this space.

- Whitespace cleanup while I'm at it

12 years agoFinal pass at having devices use their bus parent for dma tags. The
scottl [Mon, 12 Mar 2012 19:29:35 +0000 (19:29 +0000)]
Final pass at having devices use their bus parent for dma tags.  The
remaining drivers that haven't been converted have various problems or
complexities that will be dealt with later.  This list includes:

hptrr, hptmv, hpt27xx - device aggregation across multiple parents
drm - want to talk to the maintainer first
tsec, sec - Openfirmware devices, not sure if changes are warranted
fatm - Done except for unused testing code
usb - want to talk to the maintainer first
ce, cp, ctau, cx - Significant driver changes needed to convey parent info

There are also devices tucked into architecture subtrees that I'll leave
for the respective maintainers to deal with.

12 years agoRemove comments about creating DMA tags as children of the DMA tags of their
jmallett [Mon, 12 Mar 2012 19:29:32 +0000 (19:29 +0000)]
Remove comments about creating DMA tags as children of the DMA tags of their
parent bus where the code has now been modified to do so.

Reviewed by: scottl

12 years agoUse 64-bit bus space constants on 64-bit kernels.
jmallett [Mon, 12 Mar 2012 18:56:16 +0000 (18:56 +0000)]
Use 64-bit bus space constants on 64-bit kernels.

12 years agoFix a bug running the autoinstall functionality.
jpaetzel [Mon, 12 Mar 2012 18:50:37 +0000 (18:50 +0000)]
Fix a bug running the autoinstall functionality.

Submitted by: kris
Obtained from: PC-BSD

12 years agoMore conversions of drivers to use the PCI parent DMA tag.
scottl [Mon, 12 Mar 2012 18:15:08 +0000 (18:15 +0000)]
More conversions of drivers to use the PCI parent DMA tag.

12 years agoRemove more unused stuff, primarily a set of (unused, thankfully) PIO
jmallett [Mon, 12 Mar 2012 18:10:01 +0000 (18:10 +0000)]
Remove more unused stuff, primarily a set of (unused, thankfully) PIO
functions.

Adjust nearby style of one assembly function END().

12 years agoThis header file no longer exists when doing cross builds, so remove it.
adrian [Mon, 12 Mar 2012 17:25:35 +0000 (17:25 +0000)]
This header file no longer exists when doing cross builds, so remove it.

mips24k hwpmc now compiles again.

12 years agoFix VNET build broken by r232865.
melifaro [Mon, 12 Mar 2012 15:41:36 +0000 (15:41 +0000)]
Fix VNET build broken by r232865.
Temporary remove the ability to assign different number of tables per VNET instance.

12 years agoThis fixes PR 165210. Basically we just
rrs [Mon, 12 Mar 2012 15:05:17 +0000 (15:05 +0000)]
This fixes PR 165210. Basically we just
add in the netgraph interface to the list of
acceptable interfaces. A todo at the next
IETF code blitz, though is we need to review
why we screen interfaces, there was a reason ;-).

PR: 165210
MFC after: 1 week

12 years ago- Add ipfw eXtended tables permitting radix to be used for any kind of keys.
melifaro [Mon, 12 Mar 2012 14:07:57 +0000 (14:07 +0000)]
- Add ipfw eXtended tables permitting radix to be used for any kind of keys.
- Add support for IPv6 and interface extended tables
- Make number of tables to be loader tunable in range 0..65534.
- Use IP_FW3 opcode for all new extended table cmds

No ABI changes are introduced. Old userland will see valid tables for
IPv4 tables and no entries otherwise. Flush works for any table.

IP_FW3 socket option is used to encapsulate all new opcodes:
 /* IP_FW3 header/opcodes */
 typedef struct _ip_fw3_opheader {
        uint16_t opcode;        /* Operation opcode */
        uint16_t reserved[3];   /* Align to 64-bit boundary */
 } ip_fw3_opheader;

New opcodes added:
 IP_FW_TABLE_XADD, IP_FW_TABLE_XDEL, IP_FW_TABLE_XGETSIZE, IP_FW_TABLE_XLIST

ipfw(8) table argument parsing behavior is changed:
 'ipfw table 999 add host' now assumes 'host' to be interface name instead of
 hostname.

New tunable:
 net.inet.ip.fw.tables_max controls number of table supported by ipfw in given
 VNET instance. 128 is still the default value.

New syntax:
ipfw add skipto tablearg ip from any to any via table(42) in
ipfw add skipto tablearg ip from any to any via table(4242) out

This is a bit hackish, special interface name '\1' is used to signal interface
table number is passed in p.glob field.

Sponsored by Yandex LLC

Reviewed by:    ae
Approved by:    ae (mentor)

MFC after:      4 weeks

12 years agoRtld on diet part 2:
kib [Mon, 12 Mar 2012 12:16:08 +0000 (12:16 +0000)]
Rtld on diet part 2:

Do not use stdio for libmap.conf read.  Directly map the file and
parse lines from the mappings.

Reviewed by: kan
MFC after: 3 weeks

12 years agoRtld on diet part 1:
kib [Mon, 12 Mar 2012 12:15:47 +0000 (12:15 +0000)]
Rtld on diet part 1:

Provide rtld-private implementations of __stack_chk_guard,
__stack_chk_fail() and __chk_fail() symbols, to be used by functions
linked from libc_pic.a.  This avoids use of libc stack_protector.c,
which pulls in syslog(3) and stdio as dependency.

Also, do initialize rtld-private copy __stack_chk_guard, previously
libc-provided one was not initialized, since we do not call rtld
object _init() methods.

Reviewed by: kan
MFC after: 3 weeks

12 years agoAllways call fdrop().
pho [Mon, 12 Mar 2012 11:56:57 +0000 (11:56 +0000)]
Allways call fdrop().

12 years agoAmend r232857, now dropping the casts entirely, as they were not
dim [Mon, 12 Mar 2012 11:22:23 +0000 (11:22 +0000)]
Amend r232857, now dropping the casts entirely, as they were not
necessary at all.

Submitted by: stefanf

12 years agoAfter r232548, clang complains about the apparent '=-' operator (a
dim [Mon, 12 Mar 2012 11:15:44 +0000 (11:15 +0000)]
After r232548, clang complains about the apparent '=-' operator (a
left-over from ancient C times, and a frequent typo) in growfs.c:

sbin/growfs/growfs.c:1550:8: error: use of unary operator that may be intended as compound assignment (-=) [-Werror]
        blkno =- 1;
              ^~

Use 'blkno = -1' instead, to silence the error.

12 years agoFix the following warning/error with clang:
dim [Mon, 12 Mar 2012 11:04:48 +0000 (11:04 +0000)]
Fix the following warning/error with clang:

libexec/rtld-elf/rtld.c:1898:22: error: comparison between pointer and integer ('Elf_Addr *' (aka 'unsigned int *') and 'Elf_Addr' (aka 'unsigned int')) [-Werror]
    if (preinit_addr == (Elf_Addr)NULL)
        ~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~
libexec/rtld-elf/rtld.c:2039:16: error: comparison between pointer and integer ('Elf_Addr *' (aka 'unsigned int *') and 'Elf_Addr' (aka 'unsigned int')) [-Werror]
        if (init_addr != (Elf_Addr)NULL) {
            ~~~~~~~~~ ^  ~~~~~~~~~~~~~~

Reviewed by: kib

12 years agoWhen iterating over the dso program headers, the object is not initialized
kib [Mon, 12 Mar 2012 10:36:03 +0000 (10:36 +0000)]
When iterating over the dso program headers, the object is not initialized
yet, and object segments are not yet mapped.  Only parse the notes that
appear in the first page of the dso (as it should be anyway), and use
the preloaded page content.

Reported and tested by: stass
MFC after: 20 days

12 years agoRemove more unused code and declarations, and add dire warnings to the 64-bit
jmallett [Mon, 12 Mar 2012 08:13:04 +0000 (08:13 +0000)]
Remove more unused code and declarations, and add dire warnings to the 64-bit
atomic ops used by 32-bit kernels.

12 years agoConvert a number of drivers to obtaining their parent DMA tag from their
scottl [Mon, 12 Mar 2012 08:03:51 +0000 (08:03 +0000)]
Convert a number of drivers to obtaining their parent DMA tag from their
PCI device attachment.

12 years agoRemove platform APIs which are not used by any code and which had only stub
jmallett [Mon, 12 Mar 2012 07:34:15 +0000 (07:34 +0000)]
Remove platform APIs which are not used by any code and which had only stub
implementations or no implementation on all platforms.

Some of these functions might be good ideas, but their semantics were unclear
given the lack of implementation, and an unlucky porter could be fooled into
trying to implement them or, worse, being baffled when something like
platform_trap_enter() failed to be called.

12 years agoTune cpuset macros to optimize cases when CPU_SETSIZE fits into single
mav [Mon, 12 Mar 2012 07:02:16 +0000 (07:02 +0000)]
Tune cpuset macros to optimize cases when CPU_SETSIZE fits into single
machine word. For example, it turns CPU_SET() into expected shift and OR,
removing two extra shifts and additional index on memory access.

Generated code checked for kernel (optimized) and user-level (unoptimized)
cases with GCC and CLANG.

Reviewed by: attilio
MFC after: 2 weeks

12 years agoSimplify the error checking in one branch of trap_pfault() and update
alc [Mon, 12 Mar 2012 05:28:02 +0000 (05:28 +0000)]
Simplify the error checking in one branch of trap_pfault() and update
the nearby comment.

Correct the style of two return statements in trap_pfault().

Merge a comment from amd64's trap_pfault().

12 years agoMake if_ierrors updated whenever any of the following counters are
yongari [Mon, 12 Mar 2012 03:47:30 +0000 (03:47 +0000)]
Make if_ierrors updated whenever any of the following counters are
updated.
 o Number of times NIC ran out of RX buffer descriptors
 o Number of inbound packet errors
 o Number of inbound packets that were chosen to be discarded
Previously only the discarded packet counter was used to update
if_ierrors.  This change fixes wrong if_ierrors counter on
BCM570[0-4] controllers.  For BCM5705 and later controllers bge(4)
already correctly counted it.

Reported by: Eugene Grosbein <egrosbein <> rdtc dot ru>

12 years agoShow PCI bus speed and width as well as running mode of PCI-X
yongari [Mon, 12 Mar 2012 02:42:47 +0000 (02:42 +0000)]
Show PCI bus speed and width as well as running mode of PCI-X
device in device attach.  This would help to narrow down issue to a
specific controller and operating mode of the controller.
While I'm here rename BGE_MISCCFG_BOARD_ID with
BGE_MISCCFG_BOARD_ID_MASK.

12 years agoAdd workaround for PCI-X BCM5704 controller that live behind
yongari [Mon, 12 Mar 2012 02:09:47 +0000 (02:09 +0000)]
Add workaround for PCI-X BCM5704 controller that live behind
AMD-8131 PCI-X bridge.  The bridge seems to reorder write access to
mailbox registers such that it caused watchdog timeouts by
out-of-order TX completions.

Tested by: Michael L. Squires <mikes <> siralan dot org >
Reviewed by: jhb

12 years ago- Rename apb_intr to apb_filter since it's a filter handler
gonzo [Mon, 12 Mar 2012 01:23:09 +0000 (01:23 +0000)]
- Rename apb_intr to apb_filter since it's a filter handler
- Pass interrupt trapframe for handlers dow the chain
- Add PMC interrupt handler
    PMC interrupt is a special case, so we want handle it as soon as possible
    with minimum overhead. So we handle it apb filter routine.

12 years agoImplement pmc_save_user_callchain and pmc_save_kernel_callchain for MIPS
gonzo [Mon, 12 Mar 2012 01:19:41 +0000 (01:19 +0000)]
Implement pmc_save_user_callchain and pmc_save_kernel_callchain for MIPS

12 years agoBegin modifying the PB92 config file to actually generate a flashable,
adrian [Mon, 12 Mar 2012 01:15:58 +0000 (01:15 +0000)]
Begin modifying the PB92 config file to actually generate a flashable,
bootable image.

The kernel has to fit inside an 896KiB area in a 4MB SPI flash.
So a bunch of stuff can't be included (and more is to come), including
(unfortunately) IPv6.

TODO:

* GPIO modules need to be created
* Shrink the image a bit more by removing some of the CAM layer debugging
  strings.

12 years agoRemove extraneous log message
emaste [Mon, 12 Mar 2012 01:06:29 +0000 (01:06 +0000)]
Remove extraneous log message

When ntp switched between PLL and FLL mode it produced a log message
"kernel time sync status change %04x".  This issue is reported in ntp
bug 452[1] which claims that this behaviour is normal and the log
message isn't necessary.  I'm not sure exactly when it was removed, but
it's gone in the latest ntp release (4.2.6p5).

[1] http://bugs.ntp.org/show_bug.cgi?id=452

Approved by:    roberto

12 years agoSimplify the error checking in one branch of trap_pfault() and update
alc [Mon, 12 Mar 2012 00:47:13 +0000 (00:47 +0000)]
Simplify the error checking in one branch of trap_pfault() and update
the nearby comment.

Add missing whitespace to a return statement in trap_pfault().

Submitted by: kib [2]

12 years agoFix whitespace.
ed [Sun, 11 Mar 2012 22:30:06 +0000 (22:30 +0000)]
Fix whitespace.

MFC after: 1 week

12 years agoWe've supported 64-bit PTEs for some time.
jmallett [Sun, 11 Mar 2012 22:17:01 +0000 (22:17 +0000)]
We've supported 64-bit PTEs for some time.

12 years agosh: Add a test for variables with underscores in arithmetic.
jilles [Sun, 11 Mar 2012 22:12:05 +0000 (22:12 +0000)]
sh: Add a test for variables with underscores in arithmetic.

Things like $((_x+1)) are broken in stable/8 sh but work in stable/9 and
head.

12 years agoRemove superfluous brackets.
kib [Sun, 11 Mar 2012 21:25:42 +0000 (21:25 +0000)]
Remove superfluous brackets.

Submitted by: alc
MFC after: 2 weeks

12 years agoDo schedule delayed writes for async mounts.
kib [Sun, 11 Mar 2012 20:26:19 +0000 (20:26 +0000)]
Do schedule delayed writes for async mounts.
While there, make some style adjustments, like missed () around
return values.

Submitted by: bde
Reviewed by: mckusick
Tested by: pho
MFC after: 2 weeks

12 years agoDo not fall back to slow synchronous i/o when low on memory or buffers.
kib [Sun, 11 Mar 2012 20:23:46 +0000 (20:23 +0000)]
Do not fall back to slow synchronous i/o when low on memory or buffers.
The bawrite() schedules the write to happen immediately, and its use
frees the current thread to do more cleanups.

Submitted by: bde
Reviewed by: mckusick
Tested by: pho
MFC after: 2 weeks

12 years agoIn ffs_syncvnode(), pass boolean false as second argument of ffs_update().
kib [Sun, 11 Mar 2012 20:18:14 +0000 (20:18 +0000)]
In ffs_syncvnode(), pass boolean false as second argument of ffs_update().
Synchronous inode block update is not needed for MNT_LAZY callers (syncer),
and since waitfor values are not zero, code did unneccessary synchronous
update.

Submitted by: bde
Reviewed by: mckusick
Tested by: pho
MFC after: 2 weeks

12 years agoRemove not needed ARGSUSED lint command.
kib [Sun, 11 Mar 2012 20:15:12 +0000 (20:15 +0000)]
Remove not needed ARGSUSED lint command.

Submitted by: bde
MFC after: 3 days

12 years agoStop calling _init/_fini methods from crt1 for dynamic binaries. Do
kib [Sun, 11 Mar 2012 20:04:09 +0000 (20:04 +0000)]
Stop calling _init/_fini methods from crt1 for dynamic binaries.  Do
call preinit, init and fini arrays methods from crt1 for static binaries.

Mark new crt1 with FreeBSD-specific ELF note.

Move some common crt1 code into new MI file ignore_init.c, to reduce
duplication.  Also, conservatively adjust nearby sources for style.

Reviewed by: kan
Tested by: andrew (arm), flo (sparc64)
MFC after: 3 weeks

12 years agoAdd support for preinit, init and fini arrays. Some ABIs, in
kib [Sun, 11 Mar 2012 20:03:09 +0000 (20:03 +0000)]
Add support for preinit, init and fini arrays.  Some ABIs, in
particular on ARM, do require working init arrays.

Traditional FreeBSD crt1 calls _init and _fini of the binary, instead
of allowing runtime linker to arrange the calls.  This was probably
done to have the same crt code serve both statically and dynamically
linked binaries.  Since ABI mandates that first is called preinit
array functions, then init, and then init array functions, the init
have to be called from rtld now.

To provide binary compatibility to old FreeBSD crt1, which calls _init
itself, rtld only calls intializers and finalizers for main binary if
binary has a note indicating that new crt was used for linking.  Add
parsing of ELF notes to rtld, and cache p_osrel value since we parsed
it anyway.

The patch is inspired by init_array support for DragonflyBSD, written
by John Marino.

Reviewed by: kan
Tested by: andrew (arm, previous version), flo (sparc64, previous version)
MFC after: 3 weeks

12 years agoAdd a header with definitions useful for constructing ELF notes.
kib [Sun, 11 Mar 2012 19:56:58 +0000 (19:56 +0000)]
Add a header with definitions useful for constructing ELF notes.

Reviewed by: kan
MFC after:   3 weeks

12 years agoELF image can have several PT_NOTE program headers. Look for the ELF
kib [Sun, 11 Mar 2012 19:38:49 +0000 (19:38 +0000)]
ELF image can have several PT_NOTE program headers.  Look for the ELF
brand note in each header, instead of using only first one.

Reviewed by: kan
Tested by: andrew (arm), flo (sparc64)
MFC after: 3 weeks

12 years agoUpgrade the netgraph vlan node to support 802.1q, encapsulation type,
adrian [Sun, 11 Mar 2012 19:08:56 +0000 (19:08 +0000)]
Upgrade the netgraph vlan node to support 802.1q, encapsulation type,
PCP and CFI fields.

* Ethernet_type for VLAN encapsulation is tunable, default is 0x8100;
* PCP (Priority code point) and CFI (canonical format indicator) is
  tunable per VID;
* Tunable encapsulation to support 802.1q
* Encapsulation/Decapsulation code improvements

New messages have been added for this netgraph node to support the
new features.

However, the legacy "vlan" id is still supported and compiled in by
default.  It can be disabled in a future release.

TODO:

* Documentation
* Examples

PR: kern/161908
Submitted by: Ivan <rozhuk.im@gmail.com>

12 years ago- remove an extra parenthesis in a closing brace;
luigi [Sun, 11 Mar 2012 17:35:12 +0000 (17:35 +0000)]
- remove an extra parenthesis in a closing brace;
- add the macro NETMAP_RING_FIRST_RESERVED() which returns
  the index of the first non-released buffer in the ring
  (this is useful for code that retains buffers for some time
  instead of processing them immediately)

12 years agoUpdate comment.
kib [Sun, 11 Mar 2012 15:58:27 +0000 (15:58 +0000)]
Update comment.

Submitted by: gianni

12 years agoFix a bug introduced in r223938; on big-endian machines coping a 32-bit
marius [Sun, 11 Mar 2012 13:39:19 +0000 (13:39 +0000)]
Fix a bug introduced in r223938; on big-endian machines coping a 32-bit
quantum bytewise to the address of a 64-bit variable results in writing
to the "wrong" 32-bit half so adjust the address accordingly. This fix
is implemented in a hackish way for two reasons:
o in order to be able to get it into 8.3 with zero impact on the little-
  endian architectures where this bug has no effect and
o to avoid blowing the x86 boot2 out of the water again when compiling
  it with clang, which all sane versions of this fix tested do.
This change fixes booting from UFS1 file systems on big-endian machines.

MFC after: 3 days

12 years agoRemove fifo.h. The only used function declaration from the header is
kib [Sun, 11 Mar 2012 12:19:58 +0000 (12:19 +0000)]
Remove fifo.h. The only used function declaration from the header is
migrated to sys/vnode.h.

Submitted by: gianni

12 years agoReenable -Winline on MIPS now that we're not compiling Cavium's error
jmallett [Sun, 11 Mar 2012 08:12:30 +0000 (08:12 +0000)]
Reenable -Winline on MIPS now that we're not compiling Cavium's error
decoding stuff, which is impossibly-huge.

12 years agoDisable the Simple Executive's error decoding/reporting code.
jmallett [Sun, 11 Mar 2012 06:55:17 +0000 (06:55 +0000)]
Disable the Simple Executive's error decoding/reporting code.

12 years agoDo not try to use libfdt in FreeBSD.
jmallett [Sun, 11 Mar 2012 06:49:31 +0000 (06:49 +0000)]
Do not try to use libfdt in FreeBSD.

12 years agoRemove files not needed by FreeBSD.
jmallett [Sun, 11 Mar 2012 06:18:38 +0000 (06:18 +0000)]
Remove files not needed by FreeBSD.

12 years agoMerge the Cavium Octeon SDK 2.3.0 Simple Executive code and update FreeBSD to
jmallett [Sun, 11 Mar 2012 06:17:49 +0000 (06:17 +0000)]
Merge the Cavium Octeon SDK 2.3.0 Simple Executive code and update FreeBSD to
make use of it where possible.

This primarily brings in support for newer hardware, and FreeBSD is not yet
able to support the abundance of IRQs on new hardware and many features in the
Ethernet driver.

Because of the changes to IRQs in the Simple Executive, we have to maintain our
own list of Octeon IRQs now, which probably can be pared-down and be specific
to the CIU interrupt unit soon, and when other interrupt mechanisms are added
they can maintain their own definitions.

Remove unmasking of interrupts from within the UART device now that the
function used is no longer present in the Simple Executive.  The unmasking
seems to have been gratuitous as this is more properly handled by the buses
above the UART device, and seems to work on that basis.

12 years agoDisable -Winline on MIPS in preparation for the import of the latest version
jmallett [Sun, 11 Mar 2012 06:11:31 +0000 (06:11 +0000)]
Disable -Winline on MIPS in preparation for the import of the latest version
of the Cavium Simple Executive, which violates large function growth rules
in such a way that simply increasing the large function growth parameter is
insufficient.

12 years agoImport Cavium Octeon SDK 2.3.0 Simple Executive from cnusers.org.
jmallett [Sun, 11 Mar 2012 04:14:00 +0000 (04:14 +0000)]
Import Cavium Octeon SDK 2.3.0 Simple Executive from cnusers.org.

12 years agoStop some of the output from wrapping at 80 characters.
adrian [Sun, 11 Mar 2012 02:00:59 +0000 (02:00 +0000)]
Stop some of the output from wrapping at 80 characters.