]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoSVN r240684 broke the ability of the dot module to map include dependencies.
Devin Teske [Sat, 13 Oct 2012 03:56:33 +0000 (03:56 +0000)]
SVN r240684 broke the ability of the dot module to map include dependencies.
Teach the dot module about the new location these includes moved to (as part
of r240684) and clean things up a bit.

Reviewed by: adrian (co-mentor)
Approved by: adrian (co-mentor)

11 years agoReplace all uses of the vm page queues lock by a new R/W lock.
Alan Cox [Fri, 12 Oct 2012 23:26:00 +0000 (23:26 +0000)]
Replace all uses of the vm page queues lock by a new R/W lock.
Unfortunately, this lock cannot be defined as static under Xen because it
is (ab)used to serialize queued page table changes.

Tested by: sbruno

11 years agoSome 3G modems return the wrong signature in echo packets and make it
Nick Hibma [Fri, 12 Oct 2012 22:48:33 +0000 (22:48 +0000)]
Some 3G modems return the wrong signature in echo packets and make it
impossible to use LQR/ECHO. They return want_magic instead.

With this change it is now possible to use

enable lqr
set lqrperiod 5
enable echo
set echoperiod 5

in your ppp.conf file.

MFC after: 3 days

11 years agoFix build with PAE enabled. I doubt any code uses CAM_SCATTER_VALID or
Alexander Motin [Fri, 12 Oct 2012 22:06:06 +0000 (22:06 +0000)]
Fix build with PAE enabled.  I doubt any code uses CAM_SCATTER_VALID or
CAM_DATA_PHYS, or they ever correctly worked, but make this build at least.

11 years agoTemporary fix for kern/172364.
Navdeep Parhar [Fri, 12 Oct 2012 21:58:21 +0000 (21:58 +0000)]
Temporary fix for kern/172364.

PR: kern/172364
MFC after: 3 days

11 years agoUse global knob in the TP_PARA_REG3 register to disable congestion
Navdeep Parhar [Fri, 12 Oct 2012 21:48:21 +0000 (21:48 +0000)]
Use global knob in the TP_PARA_REG3 register to disable congestion
drops if the user has chosen this behaviour.

MFC after: 3 days

11 years agoAdd locking to adv(4) driver and mark it MPSAFE.
John Baldwin [Fri, 12 Oct 2012 21:31:44 +0000 (21:31 +0000)]
Add locking to adv(4) driver and mark it MPSAFE.
- Disable the support for the second channel on twin-channel EISA cards as
  the current incarnation can't possibly work correctly (it hasn't worked
  since switching to new-bus where new-bus allocates the softc).  If anyone
  bothers to test this again it can be fixed properly and brought back.
- Use device_printf() and device_get_nameunit() instead of adv_name().
- Remove use of explicit bus space handles and tags.
- Use PCI bus accessors and helper routines rather than accessing
  config registers directly.
- Handle failures from adv_attach().

Tested by: no one (hope it works)

11 years agoFix type in last commit.
Gleb Smirnoff [Fri, 12 Oct 2012 19:53:13 +0000 (19:53 +0000)]
Fix type in last commit.

Submitted by: brueffer

11 years agoGet SIM lock in several places while calling CAM functions.
Alexander Motin [Fri, 12 Oct 2012 18:21:31 +0000 (18:21 +0000)]
Get SIM lock in several places while calling CAM functions.
This fixes several use-after-free panics on systems with SAS enclosures.

Submitted by: ken@, mav@

11 years agoProtect xpt_getattr() calls with the SIM lock and assert that.
Alexander Motin [Fri, 12 Oct 2012 17:18:24 +0000 (17:18 +0000)]
Protect xpt_getattr() calls with the SIM lock and assert that.

Submitted by: ken@ (earlier version)

11 years agoUse CLOCK_UPTIME to get the uptime.
Ed Maste [Fri, 12 Oct 2012 15:03:28 +0000 (15:03 +0000)]
Use CLOCK_UPTIME to get the uptime.

11 years agoBe more explicit on how "intact" incoming packets in raw sockets are.
Gleb Smirnoff [Fri, 12 Oct 2012 12:27:30 +0000 (12:27 +0000)]
Be more explicit on how "intact" incoming packets in raw sockets are.

11 years agoRevert fixup of ip_len from r241480. Now stack isn't yet
Gleb Smirnoff [Fri, 12 Oct 2012 09:32:38 +0000 (09:32 +0000)]
Revert fixup of ip_len from r241480. Now stack isn't yet
ready for that change.

11 years agoIn ip_stripoptions():
Gleb Smirnoff [Fri, 12 Oct 2012 09:24:24 +0000 (09:24 +0000)]
In ip_stripoptions():
  - Remove unused argument and incorrect comment.
  - Fixup ip_len after stripping.

11 years agoRemove whitespace.
Joel Dahl [Fri, 12 Oct 2012 06:16:51 +0000 (06:16 +0000)]
Remove whitespace.

11 years agoSince the moduledata structure member priv is a void pointer, using
Kevin Lo [Fri, 12 Oct 2012 01:31:02 +0000 (01:31 +0000)]
Since the moduledata structure member priv is a void pointer, using
NULL instead of 0 when dealing with pointers.

11 years agoVirtio SCSI driver
Peter Grehan [Thu, 11 Oct 2012 23:41:18 +0000 (23:41 +0000)]
Virtio SCSI driver

Submitted by: Bryan Venteicher  bryanv at daemoninthecloset dot org
Reviewed by: grehan

11 years agoPatch from Bryan to fix a virtqueue issue:
Peter Grehan [Thu, 11 Oct 2012 23:03:42 +0000 (23:03 +0000)]
Patch from Bryan to fix a virtqueue issue:

    virtqueue: Fix non-indirect virtqueues

    We really must walk the entire descriptor chain in order
    to append the to be free'd chain to the existing free
    chain.

Submitted by: Bryan Venteicher (bryanv@daemoninthecloset.org)
Reported by: cognet

11 years agoMake local function static.
Ed Maste [Thu, 11 Oct 2012 21:24:07 +0000 (21:24 +0000)]
Make local function static.

11 years agoFix tiypo.
Aleksandr Rybalko [Thu, 11 Oct 2012 21:19:42 +0000 (21:19 +0000)]
Fix tiypo.

Submitted by: Luiz Otavio O Souza
Approved by: adrian (mentor)

11 years agoPoint freebsd.org cluster machines to mx1 for their smarthost.
Peter Wemm [Thu, 11 Oct 2012 20:46:04 +0000 (20:46 +0000)]
Point freebsd.org cluster machines to mx1 for their smarthost.

11 years agoUse separate malloc buckets for CAM devices, CCBs and paths. This will
Alexander Motin [Thu, 11 Oct 2012 20:14:11 +0000 (20:14 +0000)]
Use separate malloc buckets for CAM devices, CCBs and paths. This will
make it easier to track down the source of any use after free problems.

Submitted by: ken@

11 years agoDon't duplicate path/ccb allocation code, use existing functions.
Alexander Motin [Thu, 11 Oct 2012 19:57:11 +0000 (19:57 +0000)]
Don't duplicate path/ccb allocation code, use existing functions.

11 years agoExclude potential circular symlink when creating src tarball.
Ed Maste [Thu, 11 Oct 2012 18:41:32 +0000 (18:41 +0000)]
Exclude potential circular symlink when creating src tarball.

Normal release builds are not affected by this but it can happen if using
these release bits against a work tree.

Sponsored by: ADARA Networks

11 years agoAdd NG_NETFLOW_V9INFO_TYPE command to be able to request netflowv9-specific
Alexander V. Chernikov [Thu, 11 Oct 2012 16:15:18 +0000 (16:15 +0000)]
Add NG_NETFLOW_V9INFO_TYPE command to be able to request netflowv9-specific
data.

Submitted by: Dmitry Luhtionov <dmitryluhtionov at gmail.com>
MFC after: 2 weeks

11 years agoIncrease device CCB queue array size by CAM_RL_VALUES - 1 (4) elements.
Alexander Motin [Thu, 11 Oct 2012 15:21:07 +0000 (15:21 +0000)]
Increase device CCB queue array size by CAM_RL_VALUES - 1 (4) elements.
It is required to store extra recovery requests in case of bus resets.
On ATA/SATA this fixes assertion panics on HEAD with INVARIANTS enabled or
possible memory corruptions otherwise if timeout/reset happens when device
CCB queue is already full.

Reported by: gibbs@
MFC after: 1 week

11 years agoFix my last commit. Only call strunvis after properly checking the argument is
Stefan Farfeleder [Thu, 11 Oct 2012 08:18:28 +0000 (08:18 +0000)]
Fix my last commit.  Only call strunvis after properly checking the argument is
not NULL.

11 years agoDecode the first two fstab fields with strunvis(3). This allows having spaces
Stefan Farfeleder [Thu, 11 Oct 2012 07:54:29 +0000 (07:54 +0000)]
Decode the first two fstab fields with strunvis(3). This allows having spaces
in devices and mount paths, encoded as \s or \040.

PR: bin/117687
Submitted by: Martin Kammerhofer
Discussed on: arch

11 years agoApply some style. Checked with md5.
Stefan Farfeleder [Thu, 11 Oct 2012 07:39:51 +0000 (07:39 +0000)]
Apply some style. Checked with md5.

11 years agoAdd APE firmware support and improve firmware handshake procedure.
Pyun YongHyeon [Thu, 11 Oct 2012 06:43:43 +0000 (06:43 +0000)]
Add APE firmware support and improve firmware handshake procedure.
This change will enable IPMI access on 5717/5718/5719/5720 and 5761
controllers. Because ASF is not available when APE firmware is
present, bge_allow_asf tunable is ignored when driver detects APE
firmware.  Also bge(4) no longer performs two resets(one blind
reset and the other reset with firmware in mind) in device attach.
Now bge(4) performs a reset with enough information in bge_reset().
The APE firmware also needs special handling to make suspend/resume
work but it was not implemented yet.

With this change, bge(4) should work on any 5717/5718/5719/5720
controllers. Special thanks to Mike Hibler at Emulab who setup
remote debugging on Dell R820. Without his help I couldn't be able
to address several issues happened on Dell Rx20 systems. And many
thanks to Broadcom for continuing to support FreeBSD!

Submitted by: davidch (initial version)
H/W donated by: Broadcom
Tested by: many
Tested on: Del R820/R720/R620/R420/R320 and HP Proliant DL 360 G8

11 years agoFor 5717C/5719C/5720C and 57765 PHYs, do not perform any special
Pyun YongHyeon [Thu, 11 Oct 2012 06:07:48 +0000 (06:07 +0000)]
For 5717C/5719C/5720C and 57765 PHYs, do not perform any special
handling(jumbo, wire speed etc) in brgphy_reset().  Touching
BRGPHY_MII_AUXCTL register seems to confuse APE firmware such that
it couldn't establish a link.

11 years agoRework controller reset procedure. Previously driver saved
Pyun YongHyeon [Thu, 11 Oct 2012 05:48:04 +0000 (05:48 +0000)]
Rework controller reset procedure. Previously driver saved
BGE_PCI_PCISTATE register before issuing global reset. After
issuing reset, it reads BGE_PCI_PCISTATE register again and
compares the saved register value and current value. It was used to
know whether the global reset operation was completed or not.
Unfortunately, this logic caused several issues on recent BCM5717/
5718/5719 and BCM5720 controllers. It seems APE firmware accesses
some registers while global reset is in progress such that reading
BGE_PCI_PCISTATE register after reset does not yield old pre-reset
state value. This resulted in consuming too much time in global
reset and sometimes it couldn't successfully complete reset.

The BGE_MISCCFG_RESET_CORE_CLOCKS of BGE_MISC_CFG register is
self-clearing bit so driver is able to know the reset completion.
But the core-lock reset will disable indirect/flat/standard access
modes such that driver cannot poll BGE_MISCCFG_RESET_CORE_CLOCKS
bit of BGE_MISC_CFG register. So just wait enough time for
core-clock reset to complete.
Data sheet says driver should wait 100us for PCI/PCI-X devices and
100ms for PCIe devices. I chose 1ms for PCI/PCI-X since this value
was used for many years in bge(4). For PCIe devices, use 100ms as
recommended by data sheet.

bge_chipinit() also cleared BGE_MAC_MODE register which shall clear
firmware configured mode information. I think this will result in
losing ASF/IPMI link in device attachment. Let bge_reset() honor
firmware configured BGE_MAC_MODE register and don't announce driver
is UP in bge_reset(). Firmware should have control over driver until
it's fully initialized by driver.

While I'm here, enable workaround for PCI-X BCM5704 A0 in
bge_reset(). This will prevent internal arbitration logic from
switching to the other DMA engine after a retry cycle.

11 years agoCount number of times each queue pair's interrupt handler is invoked.
Jim Harris [Wed, 10 Oct 2012 23:35:16 +0000 (23:35 +0000)]
Count number of times each queue pair's interrupt handler is invoked.

Also add sysctls to query and reset each queue pair's stats, including
the new count added here.

Sponsored by: Intel

11 years agoPut the nvme_qpair mutex on its own cacheline.
Jim Harris [Wed, 10 Oct 2012 23:28:58 +0000 (23:28 +0000)]
Put the nvme_qpair mutex on its own cacheline.

Sponsored by: Intel

11 years ago - Remove ancient checks for sim->softc == NULL. It can't be NULL, as it is
Alexander Motin [Wed, 10 Oct 2012 22:02:11 +0000 (22:02 +0000)]
 - Remove ancient checks for sim->softc == NULL. It can't be NULL, as it is
set not-NULL during SIM registration and set to UMASS_GONE on destruction.
Debug messages there look broken for at least 9 years, as they dereference
softc value that was just checked to be equal to NULL.
 - Remove magic pointer value UMASS_GONE and use simple NULL instead.

Found by: Clang Static Analyzer

11 years agoAdd man pages for nvme(4) and nvd(4).
Jim Harris [Wed, 10 Oct 2012 21:38:17 +0000 (21:38 +0000)]
Add man pages for nvme(4) and nvd(4).

Sponsored by: Intel
Reviewed by: joel

11 years agoPull in r164132 from upstream llvm trunk:
Dimitry Andric [Wed, 10 Oct 2012 21:37:21 +0000 (21:37 +0000)]
Pull in r164132 from upstream llvm trunk:

  When creating MCAsmBackend pass the CPU string as well. In X86AsmBackend
  store this and use it to not emit long nops when the CPU is geode which
  doesnt support them.

  Fixes PR11212.

Pull in r164133 from upstream clang trunk:

  Follow up on llvm r164132.

This should prevent illegal instructions when building world on Geode
CPUs (e.g. Soekris).

MFC after: 3 days

11 years agoPull in r163710 from upstream llvm trunk:
Dimitry Andric [Wed, 10 Oct 2012 21:29:00 +0000 (21:29 +0000)]
Pull in r163710 from upstream llvm trunk:

  Add support for AMD Geode.

MFC after: 3 days

11 years agoNULL-ify last previously used pointer instead of last possible pointer.
Alexander Motin [Wed, 10 Oct 2012 20:41:37 +0000 (20:41 +0000)]
NULL-ify last previously used pointer instead of last possible pointer.
This should be only a cosmetic change.

Found by: Clang Static Analyzer

11 years agoAdd a "clearstats" subcommand to cxgbetool that lets you clear the
Navdeep Parhar [Wed, 10 Oct 2012 20:09:19 +0000 (20:09 +0000)]
Add a "clearstats" subcommand to cxgbetool that lets you clear the
MAC statistics for any port.

For example:
# cxgbetool t4nex0 clearstats 0

Submitted by: gnn@
MFC after: 3 days

11 years agoUpgrade to 9.8.3-P4:
Xin LI [Wed, 10 Oct 2012 19:47:52 +0000 (19:47 +0000)]
Upgrade to 9.8.3-P4:

Prevents a lockup when queried a deliberately constructed combination
of records. [CVE-2012-5166]

For more information: https://kb.isc.org/article/AA-00801

11 years agopanic() with reasonable message instead of returning zero frequency causing
Alexander Motin [Wed, 10 Oct 2012 19:46:46 +0000 (19:46 +0000)]
panic() with reasonable message instead of returning zero frequency causing
division by zero later if event timer's minimal period is above one second.
For now it is just a theoretical possibility.

Found by: Clang Static Analyzer

11 years agoVendor import of BIND 9.8.3-P4.
Xin LI [Wed, 10 Oct 2012 19:42:37 +0000 (19:42 +0000)]
Vendor import of BIND 9.8.3-P4.

11 years agoThere are SCSI conditions that are not an errors. In those cases cderror()
Alexander Motin [Wed, 10 Oct 2012 19:32:40 +0000 (19:32 +0000)]
There are SCSI conditions that are not an errors. In those cases cderror()
returns zero while request status is not CAM_REQ_CMP.  That could cause
partial device attach or other unexpected results.

Found by: Clang Static Analyzer

11 years agoAdd a driver ioctl to clear a port's MAC statistics.
Navdeep Parhar [Wed, 10 Oct 2012 19:27:40 +0000 (19:27 +0000)]
Add a driver ioctl to clear a port's MAC statistics.

Submitted by: gnn@
MFC after: 3 days

11 years agoDo not check if found IPv4 rte is dynamic if net.inet.icmp.drop_redirect is
Alexander V. Chernikov [Wed, 10 Oct 2012 19:06:11 +0000 (19:06 +0000)]
Do not check if found IPv4 rte is dynamic if net.inet.icmp.drop_redirect is
enabled. This eliminates one mtx_lock() per each routing lookup thus improving
performance in several cases (routing to directly connected interface or routing
to default gateway).

Icmp redirects should not be used to provide routing direction nowadays, even
for end hosts. Routers should not use them too (and this is explicitly restricted
in IPv6, see RFC 4861, clause 8.2).

Current commit changes rnh_machaddr function to 'stock' rn_match (and back) for every
AF_INET routing table in given VNET instance on drop_redirect sysctl change.

This change is part of bigger patch eliminating rte locking.

Sponsored by: Yandex LLC
MFC after: 2 weeks

11 years agoReally handle xpt_compile_path() error in xpt_bus_register() instead of
Alexander Motin [Wed, 10 Oct 2012 18:34:15 +0000 (18:34 +0000)]
Really handle xpt_compile_path() error in xpt_bus_register() instead of
print error message and probably crash just after it on NULL dereference.

Found by: Clang Static Analyzer

11 years agoRemove 'periph == NULL' check from bunch of periph drivers.
Alexander Motin [Wed, 10 Oct 2012 18:10:11 +0000 (18:10 +0000)]
Remove 'periph == NULL' check from bunch of periph drivers.
This condition can never be true as functions are called from single place
and the checks just pollute the code and confuse Clang Static Analyzer.

11 years agoAdd support for locate LED.
Jim Harris [Wed, 10 Oct 2012 18:01:56 +0000 (18:01 +0000)]
Add support for locate LED.

While here, change ISCI_LED to ISCI_PHY since conceptually the hardware
ties the LEDs to a phy and the LEDs for a given phy cannot be controlled
independently.

Submitted by: Paul Maulberger <Paul.Maulberger at gmx.de> (with modifications)

11 years agoAdd checks for ata_sata_scr_read() return statuses. It is mostly to silence
Alexander Motin [Wed, 10 Oct 2012 17:51:23 +0000 (17:51 +0000)]
Add checks for ata_sata_scr_read() return statuses. It is mostly to silence
Clang Static Analyzer warnings as errors there are usually unlikely.

11 years agoAdd an "i2c" subcommand to cxgbetool. You can use this to read
Navdeep Parhar [Wed, 10 Oct 2012 17:29:51 +0000 (17:29 +0000)]
Add an "i2c" subcommand to cxgbetool.  You can use this to read
information from the transceivers connected to the ports of a
cxgbe(4) based card.

# cxgbetool t4nex0 i2c <port_id> <dev_addr> <addr> [<count>]

For example:
# cxgbetool t4nex0 i2c 0 0xa0 3
0x10 [16]

(As per SFF-8472 the SFP+ module is at 0xa0 and bit 4 in the value at
address 3 indicates it's a 10Gbase-SR module, which it is.)

11 years agoMFi386 r241356
Alan Cox [Wed, 10 Oct 2012 17:15:34 +0000 (17:15 +0000)]
MFi386 r241356
  Add several asserts.

MFC after: 3 days

11 years agoAdd a driver ioctl to read a byte from any device on a port's i2c bus.
Navdeep Parhar [Wed, 10 Oct 2012 17:13:46 +0000 (17:13 +0000)]
Add a driver ioctl to read a byte from any device on a port's i2c bus.
This lets userspace read arbitrary information from the SFP+ modules
etc. on this bus.

Reading multiple bytes in the same transaction isn't possible right now.
I'll update the driver once the chip's firmware supports this.

MFC after: 3 days

11 years agoThere is no need to report the same error twice.
Navdeep Parhar [Wed, 10 Oct 2012 16:54:14 +0000 (16:54 +0000)]
There is no need to report the same error twice.

MFC after: 3 days

11 years agoRemove unused item. cxgbe's rx queue's lock was removed a long time ago.
Navdeep Parhar [Wed, 10 Oct 2012 16:52:39 +0000 (16:52 +0000)]
Remove unused item.  cxgbe's rx queue's lock was removed a long time ago.

MFC after: 3 days

11 years agoWITH_CTF is now a "normal" build option (WITHOUT_CTF is supported and
John Baldwin [Wed, 10 Oct 2012 16:07:23 +0000 (16:07 +0000)]
WITH_CTF is now a "normal" build option (WITHOUT_CTF is supported and
MK_CTF is used internally).

Reviewed by: fjoe

11 years ago- Fix the error message when a dependency string is not provided to
John Baldwin [Wed, 10 Oct 2012 14:47:46 +0000 (14:47 +0000)]
- Fix the error message when a dependency string is not provided to
  reference a missing dependency rather than a missing compile command.
- Don't append a newline to the auto-generated compile command.  The
  compile command has a newline appended when it is later output to the
  Makefile.

MFC after: 2 weeks

11 years agoRevert previous commit...
Kevin Lo [Wed, 10 Oct 2012 08:36:38 +0000 (08:36 +0000)]
Revert previous commit...

Pointyhat to: kevlo (myself)

11 years agoRemove unnecessary delay. I don't see any comments in data sheet
Pyun YongHyeon [Wed, 10 Oct 2012 05:43:04 +0000 (05:43 +0000)]
Remove unnecessary delay. I don't see any comments in data sheet
that requires 10ms delay after device reset.  Because that code was
there from day 1, I guess it was added to give enough settlement
time after updating BGE_MAC_MODE register.
The recommended delay time for BGE_MAC_MODE after updating is 40us
and it was already done in r241219.

11 years agoFix a long standing VCPU reset sequence bug on BCM5906.
Pyun YongHyeon [Wed, 10 Oct 2012 04:38:29 +0000 (04:38 +0000)]
Fix a long standing VCPU reset sequence bug on BCM5906.
The VCPU(Virtual CPU) of BCM5906 is used to provide a mechanism to
control the bootcode execution and to pick up configuration data
stored inside the EEPROM.
The bootcode of BCM5906 will check the BGE_VCPU_STATUS_DRV_RESET
bit to decide which booting procedure to choose.
Data sheet indicates the VCPU of BCM5906 should set
BGE_VCPU_STATUS_DRV_RESET bit *before* VCPU reset or global reset.

11 years agoDo not force PCIe 1.0a mode in device reset on BCM5717 and newer
Pyun YongHyeon [Wed, 10 Oct 2012 02:35:10 +0000 (02:35 +0000)]
Do not force PCIe 1.0a mode in device reset on BCM5717 and newer
controllers. BCM5785 does not require PCI 1.0a mode as well during
reset.

11 years agoHonor PHY type fiber for BCM5717/BCM5718/BCM5719/BCM5720.
Pyun YongHyeon [Wed, 10 Oct 2012 02:21:36 +0000 (02:21 +0000)]
Honor PHY type fiber for BCM5717/BCM5718/BCM5719/BCM5720.

11 years agoOn PHY write error use hex number to show the value.
Pyun YongHyeon [Wed, 10 Oct 2012 01:59:53 +0000 (01:59 +0000)]
On PHY write error use hex number to show the value.
Add more comments.

11 years agoIf the maximum payload size is 256 bytes or more, set the DMA write
Pyun YongHyeon [Wed, 10 Oct 2012 01:24:02 +0000 (01:24 +0000)]
If the maximum payload size is 256 bytes or more, set the DMA write
water mark to 256 bytes.  Otherwise controller will encounter DMA
write under run errors and would result in RX DMA hang. If the
maximum payload size is 128 bytes, the water mark is set to 128
bytes as usual.
While here, set maximum read request size to 2048 for BCM5719/BCM5720.
For other PCIe devices, use 4096. And reprogram the maximum read
request size whenever device reset is performed.

11 years agoGrab the softc from the ACPI host-pci bridge device instead of from the pci
Neel Natu [Wed, 10 Oct 2012 00:06:31 +0000 (00:06 +0000)]
Grab the softc from the ACPI host-pci bridge device instead of from the pci
endpoint device.

Reviewed by: jhb

11 years agoCast vendor-specific spell on VIA VT1818S codecs alike to VT1708S to
Alexander Motin [Tue, 9 Oct 2012 17:06:31 +0000 (17:06 +0000)]
Cast vendor-specific spell on VIA VT1818S codecs alike to VT1708S to
make analog input loopback and dual-stream playback work by enabling
signal mixing by nid 22, as it should be according to info returned by
the CODEC.  Otherwise pin nid 28 receives only signal from DAC nid 16.

PR: kern/169124
MFC after: 1 week

11 years agoAdd an unified macro to deny ability from the compiler to reorder
Attilio Rao [Tue, 9 Oct 2012 14:32:30 +0000 (14:32 +0000)]
Add an unified macro to deny ability from the compiler to reorder
instruction loads/stores at its will.
The macro __compiler_membar() is currently supported for both gcc and
clang, but kernel compilation will fail otherwise.

Reviewed by: bde, kib
Discussed with: dim, theraven
MFC after: 2 weeks

11 years agoRemove undefined behavior from sranddev() and
Eitan Adler [Tue, 9 Oct 2012 14:25:14 +0000 (14:25 +0000)]
Remove undefined behavior from sranddev() and
srandomdev(). This doesn't actually work
with any modern C compiler:

In particular, both clang and modern gcc
verisons silently elide any xor operation
with 'junk'.

Approved by: secteam
MFC after: 3 days

11 years agoReverts r234074,234105,234564,234723,234989,235231-235232 and part of
Attilio Rao [Tue, 9 Oct 2012 12:22:43 +0000 (12:22 +0000)]
Reverts r234074,234105,234564,234723,234989,235231-235232 and part of
r234247.
Use, instead, the static intializer introduced in r239923 for x86 and
sparc64 intr_cpus, unwinding the code to the initial version.

Reviewed by: marius

11 years agoPrefer NULL over 0 for pointers
Kevin Lo [Tue, 9 Oct 2012 08:27:40 +0000 (08:27 +0000)]
Prefer NULL over 0 for pointers

11 years agoFix typo: s/unknow/unknown
Kevin Lo [Tue, 9 Oct 2012 06:15:16 +0000 (06:15 +0000)]
Fix typo: s/unknow/unknown

11 years agoFix a typo (s/prefix/suffix/) and comment.
Devin Teske [Tue, 9 Oct 2012 03:54:53 +0000 (03:54 +0000)]
Fix a typo (s/prefix/suffix/) and comment.

NOTE: This is in an unused portion of the menu framework.

Reviewed by: eadler, adrian (co-mentor)
Approved by: adrian (co-mentor)

11 years agoFix an oversight that cyclic menu items actually are zero-based and can
Devin Teske [Tue, 9 Oct 2012 03:11:15 +0000 (03:11 +0000)]
Fix an oversight that cyclic menu items actually are zero-based and can
accommodate 10 different states.

Reviewed by: eadler, adrian (co-mentor)
Approved by: adrian (co-mentor)

11 years agoMake the "Options:" separator-text configurable by setting $menu_optionstext.
Devin Teske [Tue, 9 Oct 2012 01:31:03 +0000 (01:31 +0000)]
Make the "Options:" separator-text configurable by setting $menu_optionstext.

Reviewed by: eadler, adrian (co-mentor)
Approved by: adrian (co-mentor)
MFC after: 3 days

11 years agoAdd an echo to say we're "Booting..." when the overloaded "boot" Ficl word is
Devin Teske [Mon, 8 Oct 2012 23:02:35 +0000 (23:02 +0000)]
Add an echo to say we're "Booting..." when the overloaded "boot" Ficl word is
executed to better differentiate between loader-specific errors and kernel-
specific errors (if ever any of either).

This type of functionality hasn't been required before the introduction of the
advanced menu system (r222417). Adding this functionality will help different-
iate errors at the loader-level such as a BTX halt caused by heap exhaustion
and errors that may be involved with executing the kernel (wrong architecture
for example). A user can learn that messages before "Booting..." are related to
the loader(8) environment and it's Forth-ilk, while those after are not
related to loader(8) -- the point that loader(8) has ``left the building''.

This patch also includes a man-page update to color.4th(8) as the color logic
moves to a lower-level (from being included by beastie.4th to being included
by loader.4th).

After noticing a delay between execution of the overloaded "boot" FICL word and
the display of text on-screen, gcooper confirmed that the introduction of a
builtin memory test (disabled by adding hw.memtest.tests="0" to loader.conf(5))
was the cause of the delay.

This patch adds an echo to produce "Booting..." when the overloaded "boot" word
is executed (this includes from the interactive command-prompt on all arches,
from the menu system on arches that run the beastie menu, and even those arches
that run the menu but disable it by setting beastie_disable="YES" in
loader.conf(5)). When loader_color="YES" in loader.conf(5), the same message is
produced but in white text on a blue background (only the letters produced have
this background -- opposed to perhaps the entire line).

11 years agoAny pfil(9) hooks should be called with already set VNET context.
Gleb Smirnoff [Mon, 8 Oct 2012 23:02:32 +0000 (23:02 +0000)]
Any pfil(9) hooks should be called with already set VNET context.

Reviewed by: bz

11 years agoCatch up with r241245 and do not return packet back in host byte order.
Gleb Smirnoff [Mon, 8 Oct 2012 22:58:28 +0000 (22:58 +0000)]
Catch up with r241245 and do not return packet back in host byte order.

11 years agoAdd several asserts to i386 pmap, which mostly state that pv entry shall
Konstantin Belousov [Mon, 8 Oct 2012 18:33:08 +0000 (18:33 +0000)]
Add several asserts to i386 pmap, which mostly state that pv entry shall
have corresponding pte.

Reviewed by: alc
Tested by: pho
MFC after: 3 days

11 years agoIn a few places, like the implementation of ptrace(), a thread may call
Alan Cox [Mon, 8 Oct 2012 16:57:05 +0000 (16:57 +0000)]
In a few places, like the implementation of ptrace(), a thread may call
upon pmap_enter() to create a mapping within a different address space,
i.e., not the thread's own address space.  On i386, this entails the
creation of a temporary mapping to the affected page table page (PTP).  In
general, pmap_enter() will read from this PTP, allocate a PV entry, and
write to this PTP.  The trouble comes when the system is short of memory.
In order to allocate a new PV entry, an older PV entry has to be
reclaimed.  Reclaiming a PV entry involves destroying a mapping, which
requires access to the affected PTP.  Thus, the PTP mapped at the
beginning of pmap_enter() is no longer mapped at the end of pmap_enter(),
which leads to pmap_enter() modifying the wrong PTP.  To address this
problem, pmap_pv_reclaim() is changed to use an alternate method of
mapping PTPs.

Update a related comment.

Reported by: pho
Diagnosed by: kib
MFC after: 5 days

11 years agoRestrict the module to varied environments.
David E. O'Brien [Mon, 8 Oct 2012 14:08:13 +0000 (14:08 +0000)]
Restrict the module to varied environments.

11 years agoip6_ipsec_output: fix a typo in r241344
Andriy Gapon [Mon, 8 Oct 2012 13:45:40 +0000 (13:45 +0000)]
ip6_ipsec_output: fix a typo in r241344

Acting as a remote drone of glebius.

11 years agoRemove my pre-commit review request for mergemaster
Doug Barton [Mon, 8 Oct 2012 10:34:49 +0000 (10:34 +0000)]
Remove my pre-commit review request for mergemaster

11 years ago After r241245 it appeared that in_delayed_cksum(), which still expects
Gleb Smirnoff [Mon, 8 Oct 2012 08:03:58 +0000 (08:03 +0000)]
  After r241245 it appeared that in_delayed_cksum(), which still expects
host byte order, was sometimes called with net byte order. Since we are
moving towards net byte order throughout the stack, the function was
converted to expect net byte order, and its consumers fixed appropriately:
  - ip_output(), ipfilter(4) not changed, since already call
    in_delayed_cksum() with header in net byte order.
  - divert(4), ng_nat(4), ipfw_nat(4) now don't need to swap byte order
    there and back.
  - mrouting code and IPv6 ipsec now need to switch byte order there and
    back, but I hope, this is temporary solution.
  - In ipsec(4) shifted switch to net byte order prior to in_delayed_cksum().
  - pf_route() catches up on r241245 changes to ip_output().

11 years agoRework device detach. While here, move driver lock/callout
Pyun YongHyeon [Mon, 8 Oct 2012 07:33:43 +0000 (07:33 +0000)]
Rework device detach. While here, move driver lock/callout
initialization to the beginning of device attach for readability.

11 years agoNo reason to play with IP header before calling sctp_delayed_cksum()
Gleb Smirnoff [Mon, 8 Oct 2012 07:21:32 +0000 (07:21 +0000)]
No reason to play with IP header before calling sctp_delayed_cksum()
with offset beyond the IP header.

11 years agoLimit applying TX data corruption and FIFO workaround to BCM5719
Pyun YongHyeon [Mon, 8 Oct 2012 07:13:45 +0000 (07:13 +0000)]
Limit applying TX data corruption and FIFO workaround to BCM5719
A0. It's believed BCM5720 does not have the issue.

11 years agoFix typo. Check against number of allocated MSI-X vectors.
Pyun YongHyeon [Mon, 8 Oct 2012 07:01:07 +0000 (07:01 +0000)]
Fix typo. Check against number of allocated MSI-X vectors.
There is no ale(4) controller that supports MSI-X so this is not
real issue.

PR: kern/171825

11 years agoMigrate the TID TXQ accesses to a new set of macros, rather than reusing
Adrian Chadd [Sun, 7 Oct 2012 23:45:19 +0000 (23:45 +0000)]
Migrate the TID TXQ accesses to a new set of macros, rather than reusing
the ATH_TXQ_* macros.

* Introduce the new macros;
* rename the TID queue and TID filtered frame queue so the compiler
  tells me I'm using the wrong macro.

These should correspond 1:1 to the existing code.

11 years agoLoop reading the RTC registers until the same values are obtained
Warner Losh [Sun, 7 Oct 2012 20:36:46 +0000 (20:36 +0000)]
Loop reading the RTC registers until the same values are obtained
twice, as advised in the atmel docs.

Submitted by: Ian Lapore

11 years agoRemove contractions.
Joel Dahl [Sun, 7 Oct 2012 20:01:41 +0000 (20:01 +0000)]
Remove contractions.

11 years agoMinor mdoc fixes.
Joel Dahl [Sun, 7 Oct 2012 19:53:04 +0000 (19:53 +0000)]
Minor mdoc fixes.

11 years agoMake graid command line a bit more friendly by allowing volume name or
Alexander Motin [Sun, 7 Oct 2012 19:30:16 +0000 (19:30 +0000)]
Make graid command line a bit more friendly by allowing volume name or
provider name to be specified instead of geom name (first argument in all
subcommands except label).  In most cases there is only one array used
any way, so it is not really useful to make user type ugly geom names like
Intel-f0bdf223 or SiI-732c2b9448cf.  Though they can be used in some cases.

Sponsored by: iXsystems, Inc.
MFC after: 1 month

11 years agoOptimize the TLB invalidations performed by pmap_protect(). Use the new
Alan Cox [Sun, 7 Oct 2012 18:07:45 +0000 (18:07 +0000)]
Optimize the TLB invalidations performed by pmap_protect().  Use the new
range-based invalidation function instead of performing per-page
invalidations.  Don't bother invalidating mappings that don't have PTE_D
set, since they don't allow write access.

11 years agoFix the showconfig target. bmake sends debug output to stderr.
Marcel Moolenaar [Sun, 7 Oct 2012 17:48:38 +0000 (17:48 +0000)]
Fix the showconfig target. bmake sends debug output to stderr.

Submitted by: Simon Garrety <sjg@juniper.net>

11 years agoFix 32-bit library builds after the removal of adding -E to make for AS,
Marcel Moolenaar [Sun, 7 Oct 2012 16:45:38 +0000 (16:45 +0000)]
Fix 32-bit library builds after the removal of adding -E to make for AS,
CC, CXX and LD. This fix implements the intended as it should have been
implemented all along: by passing AS, CC, CXX and LD on the commandline
of the sub-make instead of in the environment of the sub-make.

Breakage pointed-out by: dim@

11 years agoComment and Copyright fixes/updates.
Devin Teske [Sun, 7 Oct 2012 15:37:30 +0000 (15:37 +0000)]
Comment and Copyright fixes/updates.

Reviewed by: adrian (co-mentor)
Approved by: adrian (co-mentor)

11 years agoImprove a few comments.
Warner Losh [Sun, 7 Oct 2012 02:08:19 +0000 (02:08 +0000)]
Improve a few comments.

11 years agoUse the RTC unit to get the time. This works on all known AT91SAM9*
Warner Losh [Sun, 7 Oct 2012 01:58:32 +0000 (01:58 +0000)]
Use the RTC unit to get the time.  This works on all known AT91SAM9*
processors, either on reboot or after power down with battery backup.
However, the AT91RM9200 RTC always resets on reboot making it just
about useless at the moment (if we support a low-power mode or an
extended sleep mode, it might become useful).

Submitted by: Ian Lepore

11 years agoata_da: set disk::d_ident from serial number
Andriy Gapon [Sat, 6 Oct 2012 21:42:07 +0000 (21:42 +0000)]
ata_da: set disk::d_ident from serial number

MFC after: 10 days

11 years agoprocstat_getprocs: honor kvm_getprocs interface - cnt is signed
Andriy Gapon [Sat, 6 Oct 2012 20:17:28 +0000 (20:17 +0000)]
procstat_getprocs: honor kvm_getprocs interface - cnt is signed

MFC after: 10 days