]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoRemove use of non-ISO-C integer types from system call tables.
Ed Schouten [Fri, 25 May 2012 21:50:48 +0000 (21:50 +0000)]
Remove use of non-ISO-C integer types from system call tables.

These files already use ISO-C-style integer types, so make them less
inconsistent by preferring the standard types.

12 years agoUpdate HID defines for E500mc and E5500 CPU cores.
Rafal Jaworowski [Fri, 25 May 2012 21:12:24 +0000 (21:12 +0000)]
Update HID defines for E500mc and E5500 CPU cores.

Obtained from: Freescale, Semihalf

12 years agoImport DTS files for the upcoming DPAA QorIQ (PowerPC) support.
Rafal Jaworowski [Fri, 25 May 2012 20:43:38 +0000 (20:43 +0000)]
Import DTS files for the upcoming DPAA QorIQ (PowerPC) support.

  - P2041RDB
  - P3041DS
  - P5020DS

Obtained from: Freescale

12 years agoAdd a partition type for nandfs to the apm, bsd, gpt and vtoc8 schemes.
Marcel Moolenaar [Fri, 25 May 2012 20:33:34 +0000 (20:33 +0000)]
Add a partition type for nandfs to the apm, bsd, gpt and vtoc8 schemes.
The gpart alias for these partition types is "freebsd-nandfs".

12 years agoinit: Remove unnecessary 2-second delay before calling reboot(2).
Jilles Tjoelker [Fri, 25 May 2012 19:45:01 +0000 (19:45 +0000)]
init: Remove unnecessary 2-second delay before calling reboot(2).

12 years agoFix physical address type to vm_paddr_t also for powerpc64.
Rafal Jaworowski [Fri, 25 May 2012 18:17:26 +0000 (18:17 +0000)]
Fix physical address type to vm_paddr_t also for powerpc64.

12 years agoAdd some AR5416/AR5418 WAR's for power-on and suspend/resume:
Adrian Chadd [Fri, 25 May 2012 17:53:57 +0000 (17:53 +0000)]
Add some AR5416/AR5418 WAR's for power-on and suspend/resume:

* Now that ah_configPCIE is called for both power on and suspend/resume,
  make sure the right bit(s) are cleared and set when suspending and
  resuming.  Specifically:

  + force disable/enable the PCIe PHY upon suspend/resume;
  + reprogram the PCIe WAR register when resuming and upon power-on.

* Add a recipe which powers down any PCIe PHY hardware inside the AR5416
  (which is the PCI variant) to save on power.  I have (currently) no way
  to test exactly how much power is saved, if any.

Tested on:

* AR5416 cardbus - although unfortunately pccard/cbb/cardbus currently
  detaches the NIC upon suspend, I don't think it's a proper test case.

* AR5418 PCIe attached to expresscard - since we're not doing PCIe APSM,
  it's also not likely a full/good test case.

In both instances I went through a handful of suspend/resume cycles and
ensured that the STA vap reassociated correctly.

TODO:

* Setup a laptop to simply sit in a suspend/resume loop, making sure that
  the NIC always correctly comes back;

* Start doing suspend/resume tests with actual traffic going on in the
  background, as I bet this process is all quite racy at the present;

* Test adhoc/hostap mode, just to be completely sure it's working correctly;

* See if I can jury rig an external power source to an AR5416 to test out
  whether ah_disablePCIE() works.

Obtained from: Qualcomm Atheros

12 years agoCorrect error message.
Pawel Jakub Dawidek [Fri, 25 May 2012 17:19:30 +0000 (17:19 +0000)]
Correct error message.

MFC after: 3 days

12 years ago* According to the reference code, AR_WA_D3_L1_DISBABLE is bit 14.
Adrian Chadd [Fri, 25 May 2012 16:45:56 +0000 (16:45 +0000)]
* According to the reference code, AR_WA_D3_L1_DISBABLE is bit 14.
* Add some other WAR bits (very usefully described too) in preparation for
  porting over some suspend/resume fixes from ath9k/Atheros.

Obtained from: Qualcomm Atheros

12 years agoDoh... Don't add __eabi to an old version tag (i.e. FBSD_1.0). Add it to the
Marcel Moolenaar [Fri, 25 May 2012 16:30:42 +0000 (16:30 +0000)]
Doh... Don't add __eabi to an old version tag (i.e. FBSD_1.0). Add it to the
current one (= FBSD_1.3).

Pointed out by: kib

12 years agoMissing vm_paddr_t bits which should have been part of r235936.
Rafal Jaworowski [Fri, 25 May 2012 15:13:55 +0000 (15:13 +0000)]
Missing vm_paddr_t bits which should have been part of r235936.

12 years agoMore Cicada/Vitesse PHY ids.
Rafal Jaworowski [Fri, 25 May 2012 15:05:17 +0000 (15:05 +0000)]
More Cicada/Vitesse PHY ids.

Obtained from: Semihalf

12 years agoMerge from x86: r232521
Marius Strobl [Fri, 25 May 2012 14:52:05 +0000 (14:52 +0000)]
Merge from x86: r232521

Exclude USB drivers (except umass and ukbd) from main kernel image.

12 years agoUndefine SCTP_PACKED before including sctp_uio.h, which doesn't
Michael Tuexen [Fri, 25 May 2012 11:14:08 +0000 (11:14 +0000)]
Undefine SCTP_PACKED before including sctp_uio.h, which doesn't
use it. Spotted by Irene Ruengeler.

MFC after: 3 days

12 years agoRevert r235918 for now and add comment explaining the reason for the
Edward Tomasz Napierala [Fri, 25 May 2012 10:08:48 +0000 (10:08 +0000)]
Revert r235918 for now and add comment explaining the reason for the
size check.

12 years agoUse 32-bit ufs_ino_t instead of ino_t to keep boot2 small and prevent
Gleb Kurtsou [Fri, 25 May 2012 09:36:39 +0000 (09:36 +0000)]
Use 32-bit ufs_ino_t instead of ino_t to keep boot2 small and prevent
unnecessary 64-bit math on 32-bit machines.

Sponsored by: Google Summer of Code 2011

12 years ago- Only use multi-threading for large files
Gabor Kovesdan [Fri, 25 May 2012 09:30:16 +0000 (09:30 +0000)]
- Only use multi-threading for large files
- Do not use mmap() by default; it can be enabled by --mmap
- Add some minor optimizations for -u
- Update manual page according to the changes

Submitted by: Oleg Moskalenko <oleg.moskalenko@citrix.com>

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Fri, 25 May 2012 09:27:16 +0000 (09:27 +0000)]
MFp4 bz_ipv6_fast:

  Use M_ZERO with malloc rather than calling bzero() ourselves.

  Change if () panic() checks to KASSERT()s as they are only
  catching invariants in code flow but not dependent on network
  input/output.

  Move initial assigments indirecting pointers after the lock
  has been aquired.

  Passing layer boundries, reset M_PROTOFLAGS.

  Remove a NULL assignment before free.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Fri, 25 May 2012 09:24:45 +0000 (09:24 +0000)]
MFp4 bz_ipv6_fast:

  Properly protect the inp read access when handling the control code.
  In the past this was expensive but given the rlock it's not so much
  anymore.

  Spotted while: optimizing udp6
  Discussed with: rwatson (a few months ago)

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoUse C99-style initialization for struct dirent in preparation for
Gleb Kurtsou [Fri, 25 May 2012 09:16:59 +0000 (09:16 +0000)]
Use C99-style initialization for struct dirent in preparation for
changing the structure.

Sponsored by: Google Summer of Code 2011

12 years agoAdd tunable/sysctl kern.cam.pmp.hide_special, controlling whether special
Alexander Motin [Fri, 25 May 2012 08:30:09 +0000 (08:30 +0000)]
Add tunable/sysctl kern.cam.pmp.hide_special, controlling whether special
PMP ports such as PMP configuration or SEMB should be exposed or hidden.
These ports were always hidden before as useless and sometimes promatic.
But with updated ses driver supporting SEMB it is no longer so straight.
Keep ports hidden by default to avoid probe request ttimeouts if SEP is
not connected to PMP's SEMB via I2C, that is very often situation.

12 years agoIn case forwarding is turned on for a given address family, refuse to
Bjoern A. Zeeb [Fri, 25 May 2012 08:17:59 +0000 (08:17 +0000)]
In case forwarding is turned on for a given address family, refuse to
queue the packet for LRO and tell the driver to directly pass it on.
This avoids re-assembly and later re-fragmentation problems when
forwarding.

It's not the best solution but the simplest and most effective for
the moment.

Should have been done: ages ago
Discussed with and by: many
MFC after: 3 days

12 years agoRemove sleep() from invalidate call in ses driver, waiting for daemon
Alexander Motin [Fri, 25 May 2012 07:57:17 +0000 (07:57 +0000)]
Remove sleep() from invalidate call in ses driver, waiting for daemon
process exit. Instead use CAM's standard reference counting to prevent
periph going away until process won't complete. I think that sleep in
single CAM SWI thread is not a good idea and may lead to deadlocks if
daemon process waits for some command completion. Combined with recent
patch avoiding use of CAM SWI for ATA it just causes panics because of
sleeps prohibited in interrupt thread context.

12 years agoRevert my local not yet properly tested changes, that leaked in
Gleb Smirnoff [Fri, 25 May 2012 07:46:24 +0000 (07:46 +0000)]
Revert my local not yet properly tested changes, that leaked in
with r235923.

12 years agodevice_add_child: protect against child device with no driver but fixed unit number
Andriy Gapon [Fri, 25 May 2012 07:32:26 +0000 (07:32 +0000)]
device_add_child: protect against child device with no driver but fixed unit number

This combination doesn't make sense, unit numbers should be hardwired
only in context of a known driver.  The wildcard devices should have
wildcard unit numbers.

Reviewed by: jhb
MFC after: 2 weeks

12 years agoFix resolving symbol names on ARM.
Grzegorz Bernacki [Fri, 25 May 2012 06:48:42 +0000 (06:48 +0000)]
Fix resolving symbol names on ARM.

On ARM, binutils are adding '$a' symbols in the symbol table for
every function (in addition to normal symbol). When gprof(1) looks
up symbol name, it often reads '$a' instead of proper function name,
because it find it first. With this fix, when read symbol name
begins with '$' and previous symbol has the same address, it will
use previous symbol name (which is proper function name).

Obtained from: Semihalf

12 years agoCorrect an error in pmap_pv_reclaim(). In a rare case, when it should have
Alan Cox [Fri, 25 May 2012 05:28:14 +0000 (05:28 +0000)]
Correct an error in pmap_pv_reclaim().  In a rare case, when it should have
returned NULL, it might instead return a pointer to a page that it had just
unmapped.

12 years agooops - ath_hal_disablepcie is actually destined for another purpose,
Adrian Chadd [Fri, 25 May 2012 05:01:27 +0000 (05:01 +0000)]
oops - ath_hal_disablepcie is actually destined for another purpose,
not to disable the PCIe PHY in prepration for reset.

Extend the enablepci method to have a "poweroff" flag, which if equal
to true means the hardware is about to go to sleep.

12 years agoFixes to man8 groff mandoc style, usage mistakes, or typos.
Warren Block [Fri, 25 May 2012 03:46:56 +0000 (03:46 +0000)]
Fixes to man8 groff mandoc style, usage mistakes, or typos.

PR: 168016
Submitted by: Nobuyuki Koganemaru
Approved by: gjb
MFC after: 3 days

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Fri, 25 May 2012 03:02:56 +0000 (03:02 +0000)]
MFp4 bz_ipv6_fast:

  Add TSO6 and LRO/IPv6 support.
  Fix the module Makefile to at least properly inlcude opt_inet6.h
  and allow builds without INET or INET6.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Fri, 25 May 2012 03:00:34 +0000 (03:00 +0000)]
MFp4 bz_ipv6_fast:

  Allow LRO to work on IPv6 as well.
  Fix the module Makefile to at least properly inlcude opt_inet6.h
  and allow builds without INET or INET6.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Fri, 25 May 2012 02:58:21 +0000 (02:58 +0000)]
MFp4 bz_ipv6_fast:

  Factor out Hop-By-Hop option processing.  It's still not heavily used,
  it reduces the footprint of ip6_input() and makes ip6_input() more
  readable.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Fri, 25 May 2012 02:23:26 +0000 (02:23 +0000)]
MFp4 bz_ipv6_fast:

  Add code to handle pre-checked TCP checksums as indicated by mbuf
  flags to save the entire computation for validation if not needed.

  In the IPv6 TCP output path only compute the pseudo-header checksum,
  set the checksum offset in the mbuf field along the appropriate flag
  as done in IPv4.

  In tcp_respond() just initialize the IPv6 payload length to 0 as
  ip6_output() will properly set it.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Fri, 25 May 2012 02:21:17 +0000 (02:21 +0000)]
MFp4 bz_ipv6_fast:

  Simple yet effective change enabling checksum "offload" on loopback
  for IPv6 to avoid expensive computations.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Fri, 25 May 2012 02:19:17 +0000 (02:19 +0000)]
MFp4 bz_ipv6_fast:

  Defer checksum calulations on UDP6 output and respect the mbuf
  flags set by NICs having done checksum validation for us already,
  thus saving the computing time in the input path as well.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Fri, 25 May 2012 02:17:16 +0000 (02:17 +0000)]
MFp4 bz_ipv6_fast:

  Add support for delayed checksum calculations in the IPv6
  output path.  We currently cannot offload to the card if we
  add extension headers (which incl. fragmentation).

  Fix two SCTP offload support copy&paste bugs: calculate
  checksums if fragmenting and no need to flag IPv4 header
  checksums in the IPv6 forwarding path.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoPrepare for improved (read: pcie) suspend/resume support.
Adrian Chadd [Fri, 25 May 2012 02:07:59 +0000 (02:07 +0000)]
Prepare for improved (read: pcie) suspend/resume support.

* Flesh out the pcie disable method for 11n chips, as they were defaulting
  to the AR5212 (empty) PCIe disable method.

* Add accessor macros for the HAL PCIe enable/disable calls.

* Call disable on ath_suspend()

* Call enable on ath_resume()

NOTE:

* This has nothing to do with the NIC sleep/run state - the NIC still
  will stay in network-run state rather than supporting network-sleep
  state.  This is preparation work for supporting correct suspend/resume
  WARs for the 11n PCIe NICs.

TODO:

* It may be feasible at this point to keep the chip powered down during
  initial probe/attach and only power it up upon the first configure/reset
  pass.  This however would require correct (for values of "correct")
  tracking of the NIC power configuration state from the driver and that
  just isn't attempted at the moment.

Tested:

* AR9280 on my Lenovo T60, but with no suspend/resume pass (yet).

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Fri, 25 May 2012 01:48:15 +0000 (01:48 +0000)]
MFp4 bz_ipv6_fast:

  Hide the ip6aux functions.  The only one referenced outside ip6_input.c
  is not compiled in yet (__notyet__) in route6.c (r235954).  We do have
  accessor functions that should be used.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days
X-MFC: KPI?

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Fri, 25 May 2012 01:45:05 +0000 (01:45 +0000)]
MFp4 bz_ipv6_fast:

  Simplify the code removing a return from an earlier else case,
  not differing from the default function return called now.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Fri, 25 May 2012 01:43:52 +0000 (01:43 +0000)]
MFp4 bz_ipv6_fast:

  We currently nowhere set IP6A_SWAP making the entire check useless
  with the current code.  Keep around but do not compile in.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Fri, 25 May 2012 01:42:48 +0000 (01:42 +0000)]
MFp4 bz_ipv6_fast:

  No need to hold the (expensive) rt lock over (expensive) logging.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Fri, 25 May 2012 01:13:39 +0000 (01:13 +0000)]
MFp4 bz_ipv6_fast:

  Factor out the tcp_hc_getmtu() call.  As the comments say it
  applies to both v4 and v6, so only write it once making it easier
  to read the protocol family specifc code.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoDon't try to set a null TERM environment.
Jamie Gritton [Fri, 25 May 2012 00:38:06 +0000 (00:38 +0000)]
Don't try to set a null TERM environment.

Submitted by: Mateusz Guzik <mjguzik gmail.com>

12 years agoCatch up with realpath(3) changes (r235266) and unbreak acpidump(8).
Jung-uk Kim [Fri, 25 May 2012 00:18:19 +0000 (00:18 +0000)]
Catch up with realpath(3) changes (r235266) and unbreak acpidump(8).

12 years agoAdd a missing " to get closer to compiling.
Bjoern A. Zeeb [Thu, 24 May 2012 23:46:17 +0000 (23:46 +0000)]
Add a missing " to get closer to compiling.

12 years agoMerge ACPICA 20120518.
Jung-uk Kim [Thu, 24 May 2012 23:12:30 +0000 (23:12 +0000)]
Merge ACPICA 20120518.

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Thu, 24 May 2012 23:03:23 +0000 (23:03 +0000)]
MFp4 bz_ipv6_fast:

  Significantly update tcp_lro for mostly two things:
  1) introduce basic support for IPv6 without extension headers.
  2) try hard to also get the incremental checksum updates right,
     especially also in the IPv4 case for the IP and TCP header.

  Move variables around for better locality, factor things out into
  functions, allow checksum updates to be compiled out, ...

  Leave a few comments on further things to look at in the future,
  though that is not the full list.

  Update drivers with appropriate #includes as needed for IPv6 data
  type in LRO.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoAtomic operation acquire barriers also need to be isync on 64-bit systems.
Nathan Whitehorn [Thu, 24 May 2012 22:14:39 +0000 (22:14 +0000)]
Atomic operation acquire barriers also need to be isync on 64-bit systems.

12 years agoRevert isync for ILP32 to sync as per my original change that I discussed
Marcel Moolenaar [Thu, 24 May 2012 22:06:00 +0000 (22:06 +0000)]
Revert isync for ILP32 to sync as per my original change that I discussed
with Nathan. Leave __ATOMIC_ACQ as an isync as per Nathan.

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Thu, 24 May 2012 22:00:48 +0000 (22:00 +0000)]
MFp4 bz_ipv6_fast:

  in_cksum.h required ip.h to be included for struct ip.  To be
  able to use some general checksum functions like in_addword()
  in a non-IPv4 context, limit the (also exported to user space)
  IPv4 specific functions to the times, when the ip.h header is
  present and IPVERSION is defined (to 4).

  We should consider more general checksum (updating) functions
  to also allow easier incremental checksum updates in the L3/4
  stack and firewalls, as well as ponder further requirements by
  certain NIC drivers needing slightly different pseudo values
  in offloading cases.  Thinking in terms of a better "library".

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoConsitently use "__LP64__".
David E. O'Brien [Thu, 24 May 2012 21:44:46 +0000 (21:44 +0000)]
Consitently use "__LP64__".
[there are 33 __LP64__'s in the kernel (minus cddl/ and contrib/),
and 11 _LP64's]

12 years agoRecognize version 3.1 of the SEC crypto engine.
Rafal Jaworowski [Thu, 24 May 2012 21:24:23 +0000 (21:24 +0000)]
Recognize version 3.1 of the SEC crypto engine.

12 years agoA few improvements:
Marcel Moolenaar [Thu, 24 May 2012 21:23:13 +0000 (21:23 +0000)]
A few improvements:
1.  Define all registers. These definitions are needed to support
    the FCM driver for direct-connect NAND.
2.  Repurpose lbc_read_reg() and lbc_write_reg() for use by localbus
    attached device drivers. Use bus_space functions directly in the
    lbc driver itself.
3.  Be smarter about programming LAWs and mapping memory. The ranges
    defined in the FDT are per bank (= chip select) and since we can
    have up to 8 banks, we could easily use more than 8 LAWs or TLB
    enrties when per-bank memory ranges need multiple LAWs or TLBs
    due to alignment or size constraints.
    We now combine all memory ranges into the fewest possible set of
    contiguous regions and program the hardware for that. Thus, a
    cleverly written FDT with 8 devices may still only need 1 LAW or
    1 TLB entry. Note that the memory ranges can be assigned randomly
    to the banks. We sort as we build to handle that.
4.  Support the FCM when programming the OR register. This is mostly
    for documention purposes as we do not have a way to define the
    mode for a bank.
5.  Remove Semihalf-ism: do not define DEBUG (only to undefine it
    again).

12 years agoFix physical address type to vm_paddr_t.
Rafal Jaworowski [Thu, 24 May 2012 21:13:24 +0000 (21:13 +0000)]
Fix physical address type to vm_paddr_t.

12 years agoRemove Semihakf-ism. DEBUG is a kernel configuration option. It
Marcel Moolenaar [Thu, 24 May 2012 21:09:38 +0000 (21:09 +0000)]
Remove Semihakf-ism. DEBUG is a kernel configuration option. It
should not be defined in source files.

12 years agoJust return if the size of the window is 0. This can happen when the
Marcel Moolenaar [Thu, 24 May 2012 21:07:10 +0000 (21:07 +0000)]
Just return if the size of the window is 0. This can happen when the
FDT does not define all ranges possible for a particular node (e.g.
PCI).
While here, only update the trgt_mem and trgt_io pointers if there's
no error. This avoids that we knowingly write an invalid target (= -1).

12 years agoEither the I/O port range or the memory mapped I/O range may not be
Marcel Moolenaar [Thu, 24 May 2012 21:01:35 +0000 (21:01 +0000)]
Either the I/O port range or the memory mapped I/O range may not be
defined in the FDT. The range will have a zero size in that case.

12 years agoo Rename kernload_ap to bp_kernelload. This to introduce a common prefix
Marcel Moolenaar [Thu, 24 May 2012 20:58:40 +0000 (20:58 +0000)]
o   Rename kernload_ap to bp_kernelload. This to introduce a common prefix
    for variables that live in the boot page.
o   Add bp_trace (yes, it's in the boot page) that gets zeroed before we
    try to wake a core and to which the core being woken can write markers
    so that we know where the core was in case it doesn't wake up. The
    boot code does not yet write markers (too follow).
o   Disable the boot page translation to allow the last 4K page to be used
    for whatever we please. It would get mapped otherwise.
o   Fix kernstart in the case of SMP. The start argument is typically page
    aligned due to the alignment requirements that come with having a boot
    page. The point of using trunc_page is that we get the actual load
    address given that the entry point is immediately following the ELF
    headers. In the SMP case this ended up exactly 4K after the load
    address. Hence subtracting 1 from start.

12 years agoFix the memory barriers for CPUs that do not like lwsync and wedge or cause
Marcel Moolenaar [Thu, 24 May 2012 20:45:44 +0000 (20:45 +0000)]
Fix the memory barriers for CPUs that do not like lwsync and wedge or cause
exceptions early enough during boot that the kernel will do ithe same.
Use lwsync only when compiling for LP64 and revert to the more proven isync
when compiling for ILP32. Note that in the end (i.e. between revision 222198
and this change) ILP32 changed from using sync to using isync. As per Nathan
the isync is needed to make sure I/O accesses are properly serialized with
locks and isync tends to be more effecient than sync.

While here, undefine __ATOMIC_ACQ and __ATOMIC_REL at the end of the file
so as not to leak their definitions.

Discussed with: nwhitehorn

12 years agoPreset (clear) the ranges we're supposed to fill from the FDT. If a
Marcel Moolenaar [Thu, 24 May 2012 20:24:49 +0000 (20:24 +0000)]
Preset (clear) the ranges we're supposed to fill from the FDT. If a
particular range (either I/O memory or I/O port) is not defined in
the FDT, we're not handing uninitialized structures back to our caller.

12 years agoAllow building for the PowerPC EABI by providing a dummy __eabi()
Marcel Moolenaar [Thu, 24 May 2012 20:12:46 +0000 (20:12 +0000)]
Allow building for the PowerPC EABI by providing a dummy __eabi()
function. The purpose of the __eabi() function is to set up the
runtime and is called first thing by main(). The runtime is already
set up for us prior to caling main, so there's nothing to do for
us in the EABI case.

12 years agoFix an inconsistency I just ran into for LDADD and DPADD. The description
Marcel Moolenaar [Thu, 24 May 2012 20:00:58 +0000 (20:00 +0000)]
Fix an inconsistency I just ran into for LDADD and DPADD. The description
for both of them use different, and presumably wrong, variables in the
example. They set LDFILES and SRCLIB respectively. I guess that's what
DPADD and LDADD were called first ...

12 years agoWork better with how make/bmake works:
Marcel Moolenaar [Thu, 24 May 2012 19:48:15 +0000 (19:48 +0000)]
Work better with how make/bmake works:
1.  Avoid a cd back into ${.CURDIR} to run mkbuiltins when we know make
    will first cd into ${.OBJDIR}. Keep the cwd to what make sets it to.
2.  Don't tell mkbuiltins where to write to (= ${.OBJDIR}), but where to
    get sources from (= ${.CURDIR}). This to compensate for point 1.

This fixes a problem with bmake's mk files that optimize ${.OBJDIR} to
expand to "." after changing cwd, not taking into account that the
target is pretty much undoing that and not getting the full path to the
object tree anymore.

12 years agoFix the following clang warning in drm2:
Dimitry Andric [Thu, 24 May 2012 19:13:54 +0000 (19:13 +0000)]
Fix the following clang warning in drm2:

  sys/dev/drm2/i915/intel_display.c:8861:3: error: expression result unused [-Werror,-Wunused-value]
                  _intel_wait_for(dev,
                  ^~~~~~~~~~~~~~~~~~~~
  @/dev/drm2/i915/intel_drv.h:55:2: note: expanded from macro '_intel_wait_for'
          ret;                                                            \
          ^~~

Reviewed by: kib
MFC after: 1 week

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Thu, 24 May 2012 18:25:09 +0000 (18:25 +0000)]
MFp4 bz_ipv6_fast:

  Introduce a (for now copied stripped down) in6_cksum_pseudo()
  function.  We should be able to use this from in6_cksum() but
  we should also ponder possible MD specific improvements.
  It takes an extra csum argument to allow for easy checks as
  will be done by the upper layer protocol input paths.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoRevert r220768 for ng_ksocket. This node is special and
Gleb Smirnoff [Thu, 24 May 2012 18:22:57 +0000 (18:22 +0000)]
Revert r220768 for ng_ksocket. This node is special and
when it is cloning, its constructor method may be called
in a context that isn't allowed to sleep.

Noticed by: Vadim Goncharov

12 years agoRevert devfs part of r235911. I was unaware about old but unfinished
Alexander Motin [Thu, 24 May 2012 18:19:23 +0000 (18:19 +0000)]
Revert devfs part of r235911. I was unaware about old but unfinished
discussion between kib@ and gibbs@ about it.

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Thu, 24 May 2012 18:05:10 +0000 (18:05 +0000)]
MFp4 bz_ipv6_fast:

  Optimize in6_cksum(), re-ordering work and limiting variable
  initialization, removing a bzero() for mostly re-initialized
  struct values, making use of the newly introduced in6_getscope(),
  as well as converting an if/panic to a KASSERT().

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoFix to kern/168294 - add flow director support into the
Jack F Vogel [Thu, 24 May 2012 17:39:54 +0000 (17:39 +0000)]
Fix to kern/168294 - add flow director support into the
static kernel build of ixgbe. Thanks Sergey for pointing
this out.

12 years agoMake g_label(4) ignore provider size when looking for UFS labels.
Edward Tomasz Napierala [Thu, 24 May 2012 16:48:33 +0000 (16:48 +0000)]
Make g_label(4) ignore provider size when looking for UFS labels.
Without it, it fails to create labels for filesystems resized by
growfs(8).

PR: kern/165962
Submitted by: Olivier Cochard-Labbe <olivier at cochard dot me>

12 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Thu, 24 May 2012 16:30:13 +0000 (16:30 +0000)]
MFp4 bz_ipv6_fast:

  Introduce in6_getscope() to allow more effective checksum
  computations without the need to copy the address to clear the
  scope.

  Sponsored by: The FreeBSD Foundation
  Sponsored by: iXsystems

Reviewed by: gnn (as part of the whole)
MFC After: 3 days

12 years agoHook up mkulzma to the build.
Josh Paetzel [Thu, 24 May 2012 16:11:51 +0000 (16:11 +0000)]
Hook up mkulzma to the build.

MFC after: 3 days

12 years agoMF amd64 r233097, r233122
Alan Cox [Thu, 24 May 2012 15:25:35 +0000 (15:25 +0000)]
MF amd64 r233097, r233122

With the changes over the past year to how accesses to the page's dirty
field are synchronized, there is no need for pmap_protect() to acquire
the page queues lock unless it is going to access the pv lists or
PMAP1/PADDR1.

Style fix to pmap_protect().

12 years agoMFprojects/zfsd:
Alexander Motin [Thu, 24 May 2012 14:07:44 +0000 (14:07 +0000)]
MFprojects/zfsd:
Revamp the CAM enclosure services driver.
This updated driver uses an in-kernel daemon to track state changes and
publishes physical path location information\for disk elements into the
CAM device database.

Sponsored by:   Spectra Logic Corporation
Sponsored by:   iXsystems, Inc.
Submitted by:   gibbs, will, mav

12 years agoReturn Supervisor SP and LR registers instead of User ones while in KDB thread.
Grzegorz Bernacki [Thu, 24 May 2012 12:41:57 +0000 (12:41 +0000)]
Return Supervisor SP and LR registers instead of User ones while in KDB thread.

Obtained from: Semihalf

12 years agoARMs don't have motherboards.
Grzegorz Bernacki [Thu, 24 May 2012 12:38:24 +0000 (12:38 +0000)]
ARMs don't have motherboards.

Obtained from: Semihalf

12 years agoAdd sn_send_failed_event to sctp_notification.
Michael Tuexen [Thu, 24 May 2012 11:52:57 +0000 (11:52 +0000)]
Add sn_send_failed_event to sctp_notification.

MFC after: 3 days

12 years agoMFprojects/zfsd:
Alexander Motin [Thu, 24 May 2012 11:24:44 +0000 (11:24 +0000)]
MFprojects/zfsd:
Hide warning behind bootverbose. Average user has nothing to do about it.

12 years agoMFprojects/zfsd:
Alexander Motin [Thu, 24 May 2012 11:20:51 +0000 (11:20 +0000)]
MFprojects/zfsd:
Generalize and unify ses device description.

12 years agoMFprojects/zfsd:
Alexander Motin [Thu, 24 May 2012 11:07:39 +0000 (11:07 +0000)]
MFprojects/zfsd:
 - Add low-level support for SATA Enclosure Management Bridge (SEMB)
devices -- SATA equivalents of the SCSI SES/SAF-TE devices.
 - Add some utility functions for SCSI SAF-TE devices access.

Sponsored by: iXsystems, Inc.

12 years agoAdd kern_fhstat(), adjust sys_fhstat() to use it.
Gleb Kurtsou [Thu, 24 May 2012 08:00:26 +0000 (08:00 +0000)]
Add kern_fhstat(), adjust sys_fhstat() to use it.

Extend kern_getdirentries() to accept uio segflag and optionally return
buffer residue.

Sponsored by: Google Summer of Code 2011

12 years agostyle.Makefile(5)
David E. O'Brien [Thu, 24 May 2012 04:10:34 +0000 (04:10 +0000)]
style.Makefile(5)

12 years agoFixes to man8 groff mandoc style, usage mistakes, or typos.
Warren Block [Thu, 24 May 2012 02:24:03 +0000 (02:24 +0000)]
Fixes to man8 groff mandoc style, usage mistakes, or typos.

PR: 168016
Submitted by: Nobuyuki Koganemaru
Approved by: gjb
MFC after: 3 days

12 years agoAllow the socket list to be limited to a specific jail id.
Andrew Thompson [Thu, 24 May 2012 01:31:10 +0000 (01:31 +0000)]
Allow the socket list to be limited to a specific jail id.

No objections: current@

12 years agoRevert r235797. GCC's mis-assumptions has led to incorrect usage of
David E. O'Brien [Wed, 23 May 2012 23:43:55 +0000 (23:43 +0000)]
Revert r235797.  GCC's mis-assumptions has led to incorrect usage of
"%q[diouxX]" within FreeBSD sources.

12 years agoUpgrade our copy of llvm/clang to 3.1 release. Release notes can be
Dimitry Andric [Wed, 23 May 2012 21:48:49 +0000 (21:48 +0000)]
Upgrade our copy of llvm/clang to 3.1 release.  Release notes can be
found at: http://llvm.org/releases/3.1/docs/ReleaseNotes.html

MFC after: 3 days

12 years agoVendor import of clang release_31 r156863 (the actual 3.1 release):
Dimitry Andric [Wed, 23 May 2012 21:39:13 +0000 (21:39 +0000)]
Vendor import of clang release_31 r156863 (the actual 3.1 release):
http://llvm.org/svn/llvm-project/cfe/branches/release_31@156863

12 years agoVendor import of llvm release_31 r156863 (the actual 3.1 release):
Dimitry Andric [Wed, 23 May 2012 21:37:39 +0000 (21:37 +0000)]
Vendor import of llvm release_31 r156863 (the actual 3.1 release):
http://llvm.org/svn/llvm-project/llvm/branches/release_31@156863

12 years agoEnable drm2 modules build.
Konstantin Belousov [Wed, 23 May 2012 21:07:01 +0000 (21:07 +0000)]
Enable drm2 modules build.

Sponsored by: The FreeBSD Foundation
MFC after: 1 month

12 years ago - Correct signedness for casts;
Xin LI [Wed, 23 May 2012 20:51:21 +0000 (20:51 +0000)]
 - Correct signedness for casts;
 - Wrap long line while I'm there.

Noticed by: pjd, avg

12 years agomdoc: Only use macros inside a reference block.
Joel Dahl [Wed, 23 May 2012 20:29:16 +0000 (20:29 +0000)]
mdoc: Only use macros inside a reference block.

12 years agomdoc: fix .Bl -offset.
Joel Dahl [Wed, 23 May 2012 20:22:09 +0000 (20:22 +0000)]
mdoc: fix .Bl -offset.

12 years agoshutdown: Remove unnecessary 2-second delay.
Jilles Tjoelker [Wed, 23 May 2012 19:25:46 +0000 (19:25 +0000)]
shutdown: Remove unnecessary 2-second delay.

12 years agoTweak condition for disabling allocation from per-CPU buckets in
Maksim Yevmenkin [Wed, 23 May 2012 18:56:29 +0000 (18:56 +0000)]
Tweak condition for disabling allocation from per-CPU buckets in
low memory situation. I've observed a situation where per-CPU
allocations were disabled while there were enough free cached pages.
Basically, cnt.v_free_count was sitting stable at a value lower
than cnt.v_free_min and that caused massive performance drop.

Reviewed by: alc
MFC after: 1 week

12 years agoFix error reported by mandoc.
Joel Dahl [Wed, 23 May 2012 18:41:45 +0000 (18:41 +0000)]
Fix error reported by mandoc.

12 years agoUse %ju to match uintmax_t usage
Xin LI [Wed, 23 May 2012 18:17:02 +0000 (18:17 +0000)]
Use %ju to match uintmax_t usage

12 years agoAdd 'cow' keyword to show per-process cow count.
Konstantin Belousov [Wed, 23 May 2012 18:11:36 +0000 (18:11 +0000)]
Add 'cow' keyword to show per-process cow count.

Submitted by: Andrey Zonov <andrey zonov org>
MFC after: 1 week

12 years agoCalculate the count of per-process cow faults. Export the count to
Konstantin Belousov [Wed, 23 May 2012 18:10:54 +0000 (18:10 +0000)]
Calculate the count of per-process cow faults.  Export the count to
userspace using the obscure spare int field in struct kinfo_proc.

Submitted by: Andrey Zonov <andrey zonov org>
MFC after: 1 week

12 years agoUse %j and cast off_t to intmax_t for now to fix build.
Xin LI [Wed, 23 May 2012 17:49:59 +0000 (17:49 +0000)]
Use %j and cast off_t to intmax_t for now to fix build.

Noticed by: bz

12 years agoAdd two new locale-specific man pages:
Isabell Long [Wed, 23 May 2012 17:13:30 +0000 (17:13 +0000)]
Add two new locale-specific man pages:
- libc/stdio/scanf_l.3
- libc/stdio/printf_l.3

Reviewed by: theraven
Approved by: gabor (mentor)
MFC after: 5 days