Commit Graph

74950 Commits

Author SHA1 Message Date
Hiroki Sato
7fe6975097 MFC r203272:
- Fix a bug when adding an interface with an invalid MTU sets the
  bridge's MTU if it is the firstly-added one while the addition
  itself fails.

- Allow SIOCSIFMTU only when all members have the same MTU.

- Remove IFT_GIF check when defining the brige MTU by the
  firstly-added interface's one.  The MTU of the gif interface
  has to be the same as the bridge's one.
2010-03-22 22:07:19 +00:00
Jung-uk Kim
a0bc6d1ca6 MFC: r205223
Fix a long standing regression of readdir(3) in fdescfs(5) introduced
in r1.48.  We were stopping at the first null pointer when multiple file
descriptors were opened and one in the middle was closed.  This restores
traditional behaviour of fdescfs.
2010-03-22 20:36:35 +00:00
Jung-uk Kim
1288863fa2 MFC: r205092
Tidy up callout for select(2) and read timeout.

- Add a missing callout_drain(9) before the descriptor deallocation.[1]
- Prefer callout_init_mtx(9) over callout_init(9) and let the callout
subsystem handle the mutex for callout function.

PR:		kern/144453
Submitted by:	Alexander Sack (asack at niksun dot com)[1]
2010-03-22 19:59:00 +00:00
Andrew Gallatin
accbb468d5 MFC 204212: Update mxge to support IFCAP_VLAN_HWTSO. 2010-03-22 14:50:08 +00:00
Andrew Gallatin
c6c73f9880 MFC 205255: Fix 2 bugs in mxge_attach() 2010-03-22 11:18:51 +00:00
Nathan Whitehorn
fca060b9f9 MFC r204297:
Move the OEA64 scratchpage to the end of KVA from the beginning, and set
its PVO to map physical address 0 instead of kernelstart. This fixes a
situation in which a user process could attempt to return this address
via KVM, have it fault while being modified, and then panic the kernel
because (a) it is supposed to map a valid address and (b) it lies in the
no-fault region between VM_MIN_KERNEL_ADDRESS and virtual_avail.

While here, move msgbuf and dpcpu back into regular KVA space for
consistency with other implementations.
2010-03-20 15:27:01 +00:00
Nathan Whitehorn
1f70273a79 MFC r204296:
Provide an implementation of pmap_dev_direct_mapped() on OEA64. This is
required in order to be able to mmap the running kernel, which is turn
required to avoid fstat returning gibberish.
2010-03-20 15:23:06 +00:00
Nathan Whitehorn
59908d2f72 MFC r204269:
Use dcbz instead of word stores for page zeroing, providing a factor of
3-4 speedup.
2010-03-20 15:21:13 +00:00
Nathan Whitehorn
aba7e013d6 MFC r204268:
Close a race involving the OEA64 scratchpage. When the scratch page's
physical address is changed, there is a brief window during which its PTE
is invalid. Since moea64_set_scratchpage_pa() does not and cannot hold
the page table lock, it was possible for another CPU to insert a new PTE
into the scratch page's PTEG slot during this interval, corrupting both
mappings.

Solve this by creating a new flag, LPTE_LOCKED, such that
moea64_pte_insert will avoid claiming locked PTEG slots even if they
are invalid. This change also incorporates some additional paranoia
added to solve things I thought might be this bug.

Reported by:	linimon
2010-03-20 15:19:57 +00:00
Nathan Whitehorn
e868629641 MFC r204128:
Reduce KVA pressure on OEA64 systems running in bridge mode by mapping
UMA segments at their physical addresses instead of into KVA. This emulates
the direct mapping behavior of OEA32 in an ad-hoc way. To make this work
properly required sharing the entire kernel PMAP with Open Firmware, so
ofw_pmap is transformed into a stub on 64-bit CPUs.

Also implement some more tweaks to get more mileage out of our limited
amount of KVA, principally by extending KVA into segment 16 until the
beginning of the first OFW mapping.

Reported by:	linimon
2010-03-20 15:15:54 +00:00
Nathan Whitehorn
6f88556c52 Fix a bug where pages being removed from memory entirely no longer have
PVOs, and so the modified state of the page can no longer be communicated
to the VM layer, causing pages not to be flushed to swap when needed, in
turn causing memory corruption. Also make several correctness adjustments
to I-Cache synchronization and TLB invalidation for 64-bit Book-S CPUs.

Obtained from:	projects/ppc64
Discussed with:	grehan
2010-03-20 15:05:44 +00:00
Nathan Whitehorn
006e2f2ce5 MFC r204903:
Place interrupt handling in a critical section and remove double
counting in incrementing the interrupt nesting level. This fixes a number
of bugs in which the interrupt thread could be preempted by an IPI,
indefinitely delaying acknowledgement of the interrupt to the PIC, causing
interrupt starvation and hangs.

Reported by:	linimon
Reviewed by:	marcel, jhb
2010-03-20 14:55:22 +00:00
Nathan Whitehorn
81484b9174 MFC r204082,204179,204180,204218,204241,204247,204270,204692:
Provide thermal management and monitoring features in smu(4). This allows
fan control and thermal monitoring on SMU-based Apple G5 machines, as well
as an led(4) interface to control the sleep LED.
2010-03-20 14:49:44 +00:00
Pyun YongHyeon
4f7bf104f0 MFC r202717:
- Added a workaround for NC-SI management firmware that would allow
    frames to be accepted while the driver is resetting the hardware.
    This failure is generally observed when broadcast frames are received
    during driver load and will generate "Unable to write CTX memory"
    errors.
  - Small changes to driver flags display.

PR:	kern/135836, kern/140684
2010-03-19 00:26:45 +00:00
Pyun YongHyeon
d5eda01f75 MFC r204149:
Add TSO support on VLANs. Intentionally separated IFCAP_VLAN_HWTSO
  from IFCAP_VLAN_HWTAGGING. I think some hardwares may be able to
  TSO over VLAN without VLAN hardware tagging.
  Driver changes and userland support will follow.
2010-03-18 19:04:04 +00:00
Pyun YongHyeon
12c4b5ef43 MFC r202826-202827,204146
r202826:
  s/Mhz/MHz/g

  Submitted by:	N.J. Mann <njm <> njm dot me dot uk >

r202827:
  Yukon Ultra2 has 125MHz clock.

r204146:
  Correct inversed programming of ethernet hardware address on
  big-endian architecture.

  Submitted by:	C. Jayachandran <c.jayachandran at gmail dot com> (initial version)
2010-03-18 18:58:24 +00:00
Pyun YongHyeon
0debac0d3a MFC r203358,203716:
r203358:
  PCI express device status register has W1C feature. Writing 0 has
  no effect. Make sure to clear error bits by writing 1. [1]
  While I'm here use predefined value instead of hardcodig magic
  vlaue.

  Submitted by:	msaitoh at NetBSD [1]

r203716:
  Move device specific flag configuration to attach routine.
  The softc obtained in device probe wouldn't be the same one used in
  device attach. Drivers should not assume any values stored in softc
  structure in probe routine will be available for its attach routine.
2010-03-18 18:50:20 +00:00
Pyun YongHyeon
bb8c5f9792 MFC r203355:
Add more bit definitions to PCI express device control and device
  status register.
2010-03-18 18:44:08 +00:00
Pyun YongHyeon
194bfbdd24 MFC r202821-202822.
r202821:
  Fix a long standing ASF heartbeat sending bug. The initial
  implementation of heartbeat interval was 2 but there was typo which
  caused the heartbeat is sent approximately every 5 seconds. This
  caused unintended controller reset by firmware because firmware
  thought OS was crashed.

  Submitted by:	Floris Bos < info <> je-eigen-domein dot nl >
  Tested by:	Andrzej Tobola < ato <> iem dot pw dot edu dot pl >

r202822:
  Use new handshake command for BCM5750 or new controllers.
2010-03-18 18:35:28 +00:00
Max Laier
29f2c008fd MFC r203834 and r205197: Make ALTQ work for drbr consumers. 2010-03-18 17:00:44 +00:00
Rafal Jaworowski
7088545a40 MFC r205027
Let detailed info about CPU features print on Marvell Sheeva CPU as well.

Provide missing entry in the cpu_classes[].

Reported by:	Maks Verver
2010-03-18 11:53:32 +00:00
Gavin Atkinson
0761ef3362 Merge r203622 from head:
Add support for a few more Sony-specific ACPI features (default display
  brightness, wired LAN power and bass gain), and update the description of
  one previously unknown feature (display contrast).  While here, expand on
  a comment and remove two defines left over from an old version of the code.

  Also update man page to document the above changes, and correct grammar.

PR:		kern/127581
2010-03-17 20:39:21 +00:00
Rafal Jaworowski
9f36044770 MFC r205028
Fix ARM cache handling yet more.

 1) vm_machdep.c: remove the dangling allocations so they do not
    un-necessarily turn off the cache upon consecutive access.

 2) busdma_machdep.c: remove the same amount than shadow mapped.

Reported by:	Maks Verver
Submitted by:	Mark Tinguely
Reviewed by:	Grzegorz Bernacki
2010-03-15 19:59:16 +00:00
Rafal Jaworowski
7bfaecdca3 MFC r204764
Provide correct TCLK value for Kirkwood A1 silicon revision.

While there improve SOC ID output accordingly.

Obtained from:	Semihalf
2010-03-15 19:51:24 +00:00
Marius Strobl
8bf5ec1047 MFC: r204222
According to the Linux sungem driver, in case of Apple (K2) GMACs
GEM_MIF_CONFIG_MDI0 cannot be trusted when the firmware has powered
down the chip so the internal transceiver has to be hardcoded. This
is also in line with the AppleGMACEthernet driver, which just doesn't
distinguish between internal/external transceiver and MDIO/MDI1
respectively in the first place. Tested by: Andreas Tobler
2010-03-15 19:13:36 +00:00
Marius Strobl
a130bd42f5 MFC: r204144
Add support for BCM54K2 found in combination with Apple K2 GMAC.

Submitted by:   Andreas Tobler
Obtained from:  OpenBSD
2010-03-15 19:04:44 +00:00
Jung-uk Kim
256794862e MFC: r204235
Fix FBIO_ADPINFO ioctl on amd64.
2010-03-15 18:22:19 +00:00
Bruno Ducrot
2173958d3e MFC r204519:
Deliver siginfo when signal is generated by thr_kill(2) (SI_USER with properly
filled si_uid and si_pid).

PR:		141956
2010-03-15 15:33:32 +00:00
Jilles Tjoelker
873d27446a MFC r204410: Include terminated threads in ps's process cpu time field.
When a kinfo_proc is filled, first fill_kinfo_proc_only() fills in
ki_runtime using p->p_rux.rux_runtime (all cpu time used by the process
including terminated threads). If information for a specific thread is
requested, fill_kinfo_thread() then overwrites this with the thread's
td->td_runtime (good). If not, fill_kinfo_aggregate() overwrote it with
the sum of all threads' td->td_runtime which does not include terminated
threads.

This affects ps(1)'s TIME field, not its %CPU field nor anything in
top(1).
2010-03-14 13:07:40 +00:00
Bernd Walter
6c96d2f595 MFC 204462,204463,204476: fix multicast hashes 2010-03-13 16:37:17 +00:00
Bernhard Schmidt
36026f82d6 MFC r203934:
Fix for the Intel WiFi Link 1000.  The EEPROM image is in the OTPROM block
before the last block, not in the last block itself.

Approved by:	rpaulo (mentor)
Obtained from:	OpenBSD
2010-03-11 17:15:40 +00:00
Andriy Gapon
e850e4719f MFC r203785: acpi: drop the second bus_generic_attach pass
X-MFCto7 after: 1 week
2010-03-11 08:58:13 +00:00
Andriy Gapon
57ff35ce74 MFC r203776: acpi cpu: probe+attach before all other enumerated children
X-MFCto7 after:	1 week
2010-03-11 08:55:03 +00:00
Fabien Thomas
4e0c5d79a0 MFC r204878:
Change the way shutdown is handled for log file.

 pmc_flush_logfile is now non-blocking and just ask the kernel
 to shutdown the file. From that point, no more data is
 accepted by the log thread and when the last buffer is flushed
 the file is closed.

 This will remove a deadlock between pmcstat asking for
 flush while it cannot flush the pipe itself.
2010-03-11 07:35:30 +00:00
Pyun YongHyeon
f4153ff1ea MFC r204647:
Remove programming LED register and enable 25MHz TX clock for
  88E1149 PHY. This will fix intermittent watchdog timeouts as well
  as very slow network performance on 88E8072 Yukon Extreme.

  PR:	kern/144148
2010-03-10 22:21:07 +00:00
John Baldwin
7a547c991a MFC 204638:
Allow lseek(SEEK_END) to work on disk devices by using the DIOCGMEDIASIZE
to determine the media size.
2010-03-10 19:47:05 +00:00
Jung-uk Kim
0cd9e69dae MFC: r197438, r203810, r203813, r203935, r203936
Sync acpi_video(4) with HEAD.

r197438:
Uninline an instance of STAILQ_FOREACH_SAFE().

r203810:
Implement LCD brightness control notify handler.

r203813:
Make sanity check slightly more useful and tweak an error message.

r203935:
Add support for `cycle' and `zero' events for LCD brightness control.

r203936:
Rename some macros to clarify their intentions and fix style nits.
2010-03-10 17:58:32 +00:00
Konstantin Belousov
bf5483fddc MFC r204590:
Correct mfip module dependency on mfi. This allows mfip to be loaded as
module when mfi is a module itself.
2010-03-09 13:32:50 +00:00
John Baldwin
cd6f0f7554 MFC 204518:
Print the contents of the miscellaneous (MISC) register to the console if
it is valid along with the other register values when a machine check is
encountered.
2010-03-08 21:36:20 +00:00
Qing Li
44520d2930 MFC 204402
Use reference counting instead of locking to secure an address while
that address is being used to generate temporary IPv6 address. This
approach is sufficient and avoids recursive locking.
2010-03-08 21:30:12 +00:00
Alexander Motin
f50241e452 MFC r204648:
Several changes to fix livelock under high load, introduced by r203489:
 - change the way in which command queue overflow is handled;
 - do not expose to CAM two command slots, used for driver's internal purposes;
 - allow driver to use up to 1024 command slots, instead of 256 before.
2010-03-08 16:53:58 +00:00
Luigi Rizzo
f078d8617f MFC r197137 and r200510, which fixes a problem in 8.0
with callouts firing one tick too late. See the logs for
the original patch for details.
RELENG_7 is not affected by the problem.
2010-03-07 14:29:12 +00:00
Ivan Voras
90cb9e50f4 MFC r204611, r204633: Comment and better sysctl documentation string for
VM guest detection variable and sysctl.
2010-03-07 12:29:50 +00:00
Konstantin Belousov
272a1b6901 MFC r204464:
Several fixes for miscellaneous clone handlers in if_tun and if_tap.
2010-03-07 09:52:35 +00:00
Marcel Moolenaar
d5f57f7e08 MFC revs 203696, 203708, 203783 and 203788:
Add PT_VM_TIMESTAMP and PT_VM_ENTRY so that the tracing process can
obtain the memory map of the traced process.

Requested by: kib@
2010-03-07 00:05:44 +00:00
Konstantin Belousov
d3fe3690fb MFC r204413:
For kinfo_proc in kp->ki_siglist, return the set of the signals pending
in the process queue when gathering information for the process, and set
of signals pending for the thread, when gathering information for the
thread.
2010-03-06 12:35:33 +00:00
Rafal Jaworowski
0500dff0e4 MFC r204283
Do not force verbose and single mode in non-metadata boot case.

We want to go multi-user by default also in case of booting without
loader(8).
2010-03-04 20:22:48 +00:00
Rafal Jaworowski
c1e2139303 MFC r204317
Fix handling of GPT disk partition index.

Obtained from:	Semihalf
2010-03-04 20:12:12 +00:00
Rafal Jaworowski
17b7e3fbec MFC r204316
Let loader(8) for U-Boot use default storage more flexibly.

Obtained from:	Semihalf
2010-03-04 20:07:59 +00:00
Rafal Jaworowski
bdf0c295b9 MFC r204315
Enable U-Boot storage for PowerPC. While there fix loader(8) help file name.
2010-03-04 20:03:26 +00:00