opnsense-src/sys/powerpc
Konstantin Belousov 70a7dd5d5b Fix issues with zeroing and fetching the counters, on x86 and ppc64.
Issues were noted by Bruce Evans and are present on all architectures.

On i386, a counter fetch should use atomic read of 64bit value,
otherwise carry from the increment on other CPU could be lost for the
given fetch, making error of 2^32.  If 64bit read (cmpxchg8b) is not
available on the machine, it cannot be SMP and it is enough to disable
preemption around read to avoid the split read.

On x86 the counter increment is not atomic on purpose, which makes it
possible for the store of the incremented result to override just
zeroed per-cpu slot.  The effect would be a counter going off by
arbitrary value after zeroing.  Perform the counter zeroing on the
same processor which does the increments, making the operations
mutually exclusive.  On i386, same as for the fetching, if the
cmpxchg8b is not available, machine is not SMP and we disable
preemption for zeroing.

PowerPC64 is treated the same as amd64.

For other architectures, the changes made to allow the compilation to
succeed, without fixing the issues with zeroing or fetching.  It
should be possible to handle them by using the 64bit loads and stores
atomic WRT preemption (assuming the architectures also converted from
using critical sections to proper asm).  If architecture does not
provide the facility, using global (spin) mutex would be non-optimal
but working solution.

Noted by:  bde
Sponsored by:	The FreeBSD Foundation
2013-07-01 02:48:27 +00:00
..
aim o Relax locking assertions for vm_page_find_least() 2013-05-21 20:38:19 +00:00
booke o Relax locking assertions for vm_page_find_least() 2013-05-21 20:38:19 +00:00
conf Tidy up some CVS workarounds. 2013-05-12 01:53:47 +00:00
cpufreq Remove unused variables. Spotted by a cppcheck 2011-01-06 20:19:01 +00:00
fpu Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
include Fix issues with zeroing and fetching the counters, on x86 and ppc64. 2013-07-01 02:48:27 +00:00
mambo kern cons: introduce infrastructure for console grabbing by kernel 2011-12-17 15:08:43 +00:00
mpc85xx Align the PCI Express #defines with the style used for the PCI-X 2012-09-18 22:04:59 +00:00
ofw Cache the Open Firmware CPU properties at attach time, so we don't always 2013-06-23 14:20:54 +00:00
powermac Only check fan type once. Not only is continuously rechecking pointless, a 2013-05-05 22:42:10 +00:00
powerpc Fix a KTR_BUSDMA format string. 2013-06-18 06:55:58 +00:00
ps3 MFcalloutng: 2013-02-28 10:46:54 +00:00
psim - With the demise of !ATA_CAM, ATA_STATIC_ID is the only ata(4) related 2013-04-06 19:12:49 +00:00
wii Add support for the second GPIO pin bank on the Wii and add support for 2013-05-18 19:30:42 +00:00