nwhitehorn [Sat, 20 Mar 2010 15:27:01 +0000 (15:27 +0000)]
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.
nwhitehorn [Sat, 20 Mar 2010 15:23:06 +0000 (15:23 +0000)]
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.
nwhitehorn [Sat, 20 Mar 2010 15:19:57 +0000 (15:19 +0000)]
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.
nwhitehorn [Sat, 20 Mar 2010 15:15:54 +0000 (15:15 +0000)]
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.
nwhitehorn [Sat, 20 Mar 2010 15:05:44 +0000 (15:05 +0000)]
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.
nwhitehorn [Sat, 20 Mar 2010 14:55:22 +0000 (14:55 +0000)]
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.
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.
yongari [Fri, 19 Mar 2010 00:26:45 +0000 (00:26 +0000)]
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.
yongari [Thu, 18 Mar 2010 19:04:04 +0000 (19:04 +0000)]
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.
yongari [Thu, 18 Mar 2010 18:50:20 +0000 (18:50 +0000)]
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.
yongari [Thu, 18 Mar 2010 18:35:28 +0000 (18:35 +0000)]
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.
gavin [Wed, 17 Mar 2010 20:39:21 +0000 (20:39 +0000)]
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.
gavin [Wed, 17 Mar 2010 20:27:35 +0000 (20:27 +0000)]
Merge r203835 from head:
When growing a UFS1 filesystem, we need to initialise all inodes in any new
cylinder groups that are created. When the filesystem is first created,
newfs always initialises the first two blocks of inodes, and then in the
UFS1 case will also initialise the remaining inode blocks. The changes in
growfs.c 1.23 broke the initialisation of all inodes, seemingly based on
this implementation detail in newfs(8). The result was that instead of
initialising all inodes, we would actually end up initialising all but the
first two blocks of inodes. If the filesystem was grown into empty
(all-zeros) space then the resulting filesystem was fine, however when
grown onto non-zeroed space the filesystem produced would appear to have
massive corruption on the first fsck after growing.
A test case for this problem can be found in the PR audit trail.
Fix this by once again initialising all inodes in the UFS1 case.
dougb [Wed, 17 Mar 2010 07:26:00 +0000 (07:26 +0000)]
MFC r205145:
Make it more clear in the docs that -a is not compatible with -iFU,
and enforce this in the code. Apparently a lot of users mistakenly
combine -a with these flags and are then mystified that no changes
were made.
While I'm here, fix a trailing space in mergemaster.8
marius [Mon, 15 Mar 2010 19:13:36 +0000 (19:13 +0000)]
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
marius [Mon, 15 Mar 2010 18:32:57 +0000 (18:32 +0000)]
MFC: r204974, r205002
- The OPSZ macro actually only does the right thing for int32 and int64
operands but not for double and extended double ones. Instead of trying
to fix the macro just nuke it and unroll the loops in the correct way
though as extended double operands turn out to be the only special case.
- For FxTO{s,d,q} the source operand is int64 so rs2 has to be re-decoded
after setting type accordingly as it's generally decoded using the low
2 bits as the type, which are 0 for these three instructions.
- Similarly, in case of F{s,d,q}TOx the target is int64 so rd has to be
re-decoded using not only the operand mask appropriate for int64 but
also the correct register number encoding.
- Use const where appropriate.
- Wrap long lines.
jilles [Sun, 14 Mar 2010 13:07:40 +0000 (13:07 +0000)]
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).
jh [Fri, 12 Mar 2010 06:56:51 +0000 (06:56 +0000)]
MFC r204447:
In _gettemp(), check that the length of the path doesn't exceed
MAXPATHLEN. Otherwise the path name (or part of it) may not fit to
carrybuf causing a buffer overflow.
delphij [Fri, 12 Mar 2010 00:51:13 +0000 (00:51 +0000)]
MFC r203760: Improve time precision for grdc(6):
Traditionally, grdc would obtain time through time(3) which in turn gets
only the second part of clock (CLOCK_SECOND), and sleep for 1 second after
each screen refresh.
This approach would have two problems. First, we are not guaranteed to
be waken up at the beginning of a whole second, which will typically
exhibit as a "lag" on second number. Second, because we sleep for whole
second, and the refresh process would take some time, the error would
accumulate from time to time, making the lag variable.
Make grdc(6) to use time(3) to get time only at the beginning, and sample
time in CLOCK_REALTIME_FAST granularity after refreshing, and use the
nanosecond part to caculate how much time we want to sleep.
fabient [Thu, 11 Mar 2010 07:36:45 +0000 (07:36 +0000)]
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.
fabient [Thu, 11 Mar 2010 07:35:30 +0000 (07:35 +0000)]
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.
yongari [Wed, 10 Mar 2010 22:21:07 +0000 (22:21 +0000)]
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.
jhb [Mon, 8 Mar 2010 21:36:20 +0000 (21:36 +0000)]
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.
qingli [Mon, 8 Mar 2010 21:30:12 +0000 (21:30 +0000)]
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.
edwin [Mon, 8 Mar 2010 21:29:00 +0000 (21:29 +0000)]
MFC of tzdata2010e, r204887
- Adjust beginning / end of DST in Bangladesh (minimal impact)
- Fiji ends DST one month earlier to last Sunday of March
- Samoa changes
- Chile extends DST until 3 April this year.
mav [Mon, 8 Mar 2010 16:53:58 +0000 (16:53 +0000)]
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.
fabient [Mon, 8 Mar 2010 07:53:44 +0000 (07:53 +0000)]
MFC r204783:
Bug fixed:
- no display on serial terminal in top mode.
- display alignment for continuation string.
- correct invalid value used for display limit.
luigi [Sun, 7 Mar 2010 14:29:12 +0000 (14:29 +0000)]
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.
gshapiro [Sun, 7 Mar 2010 02:02:07 +0000 (02:02 +0000)]
MFC: Enable the use of nanosleep() instead of using pause() and signals.
This Makefile change can be removed when the next version of sendmail
is imported as it will have this built in to the FreeBSD conf.h section.
marcel [Sun, 7 Mar 2010 00:05:44 +0000 (00:05 +0000)]
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.
kib [Sat, 6 Mar 2010 12:35:33 +0000 (12:35 +0000)]
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.
fabient [Fri, 5 Mar 2010 22:40:31 +0000 (22:40 +0000)]
MFC 203790:
- Reorganize code in 'plugin' to share log processing.
- Kcachegrind (calltree) support with assembly/source
code mapping and call count estimator (-F).
- Top mode for calltree and callgraph plugin (-T).
kib [Thu, 4 Mar 2010 07:12:44 +0000 (07:12 +0000)]
MFC r204307:
Make pause(3) implementation not depended on the legacy sigcompat.c
interfaces. Do not block rt signals during and after pause(3) calls.
Use private libc namespace to call proper methods.
kib [Thu, 4 Mar 2010 07:08:01 +0000 (07:08 +0000)]
MFC r204308:
Do not restrict the allowed signals that can be specified by number
to the list of signals that has symbolic name. It was impossible to
send rt signals with kill(1) due to the check.
alc [Tue, 2 Mar 2010 16:29:08 +0000 (16:29 +0000)]
MFC r204420
When running as a guest operating system, the FreeBSD kernel must assume
that the virtual machine monitor has enabled machine check exceptions.
Unfortunately, on AMD Family 10h processors the machine check hardware
has a bug (Erratum 383) that can result in a false machine check exception
when a superpage promotion occurs. Thus, I am disabling superpage
promotion when the FreeBSD kernel is running as a guest operating system
on an AMD Family 10h processor.