238917 83 184 98 382 121 136 217 157 193 365 271 575 1120 165 379 151 126 302 247 267 1410 128 361 377 414 261 141 1165 109 182 157 971 172 1444 154 727 1201 223 378 172 127 185 239 126 345 491 149 110 143 118 333 126 205 315 894 315 125 4880 700 1082 215 201 392 264 1097 376 202 202 408 241 135 121 180 282 1055 247 448 580 224 181 128 208 268 98 K 10 svn:author V 3 jhb K 8 svn:date V 27 2012-07-30T20:44:45.679552Z K 7 svn:log V 92 The linux_lstat() system call accepts a pointer to a 'struct l_stat', not a 'struct ostat'. END K 10 svn:author V 3 jhb K 8 svn:date V 27 2012-07-30T20:45:17.784026Z K 7 svn:log V 7 Regen. END K 10 svn:author V 6 issyl0 K 8 svn:date V 27 2012-07-30T20:56:19.275482Z K 7 svn:log V 286 Add more locale-specific functions to the relevant man pages and Makefile: - lib/libc/locale/islower.3 - lib/libc/locale/ispunct.3 - lib/libc/locale/nl_langinfo.3 - lib/libc/locale/isgraph.3 - lib/libc/locale/isspace.3 Reviewed by: bz Approved by: theraven MFC after: 5 days END K 10 svn:author V 4 joel K 8 svn:date V 27 2012-07-30T21:02:44.396267Z K 7 svn:log V 28 Remove trailing whitespace. END K 10 svn:author V 3 imp K 8 svn:date V 27 2012-07-30T21:19:19.114173Z K 7 svn:log V 44 List the members of the AT91SAM9G45 family. END K 10 svn:author V 3 imp K 8 svn:date V 27 2012-07-30T21:30:43.821937Z K 7 svn:log V 124 These files will support the whole at91sam9x5 family when done, so rename them now before they get copied further afield... END K 10 svn:author V 5 kargl K 8 svn:date V 27 2012-07-30T21:55:49.853322Z K 7 svn:log V 63 Whitespace. Submitted by: bde Approved by: das (pre-approved) END K 10 svn:author V 5 kargl K 8 svn:date V 27 2012-07-30T21:58:28.192556Z K 7 svn:log V 99 ieeefp.h is only needed on i386 class hardware. Submitted by: bde Approved by: das (pre-approved) END K 10 svn:author V 6 davide K 8 svn:date V 27 2012-07-30T22:46:42.381500Z K 7 svn:log V 269 Until now KTR_ENTRIES, which defines the size of circular buffer used in ktr(4), was constrained to be a power of two. Remove this constraint and update sys/conf/NOTES accordingly. Reviewed by: jhb Approved by: gnn (mentor) Sponsored by: Google Summer of Code 2012 END K 10 svn:author V 2 mm K 8 svn:date V 27 2012-07-30T23:14:24.667640Z K 7 svn:log V 179 Partial MFV (illumos-gate 13753:2aba784c276b) 2762 zpool command should have better support for feature flags References: https://www.illumos.org/issues/2762 MFC after: 2 weeks END K 10 svn:author V 6 davide K 8 svn:date V 27 2012-07-31T00:46:19.664728Z K 7 svn:log V 479 - Fix statistics for direct execution callouts as already anticipated in the previous commit, providing a set of new SYSCTLs. Differently from what happened with callout executing in SWI threads, here we don't provide stats for callouts running with Giant Lock held, as this is a sleeping mutex, and so we cannot held it when we're running from hw interrupt context. - Properly increment the variable 'depth' in softclock(), which otherwhise would be unused. Reviewed by: mav END K 10 svn:author V 7 davidxu K 8 svn:date V 27 2012-07-31T02:00:37.289143Z K 7 svn:log V 1022 When a thread is blocked in direct write state, it only sets PIPE_DIRECTW flag but not PIPE_WANTW, but FIFO pipe code does not understand this internal state, when a FIFO peer reader closes the pipe, it wants to notify the writer, it checks PIPE_WANTW, if not set, it skips calling wakeup(), so blocked writer never noticed the case, but in general, the writer should return from the syscall with EPIPE error code and may get SIGPIPE signal. Setting the PIPE_WANTW fixed problem, or you can turn off direct write, it should fix the problem too. This bug is found by PR/170203. Another bug in FIFO pipe code is when peer closes the pipe, another end which is being blocked in select() or poll() is not notified, it missed to call pipeselwakeup(). Third problem is found in poll regression test, the existing code can not pass 6b,6c,6d tests, but FreeBSD-4 works. This commit does not fix the problem, I still need to study more to find the cause. PR: 170203 Tested by: Garrett Copper < yanegomi at gmail dot com > END K 10 svn:author V 6 adrian K 8 svn:date V 27 2012-07-31T02:18:10.758966Z K 7 svn:log V 70 Placeholder ioctl for an upcoming rate control statistics API change. END K 10 svn:author V 6 adrian K 8 svn:date V 27 2012-07-31T02:28:32.024084Z K 7 svn:log V 283 Break out the hardware handoff and TX DMA restart code into methods. These (and a few others) will differ based on the underlying DMA implementation. For the EDMA NICs, simply stub them out in a fashion which will let me focus on implementing the necessary descriptor API changes. END K 10 svn:author V 6 adrian K 8 svn:date V 27 2012-07-31T03:09:48.958834Z K 7 svn:log V 56 Migrate some more TX side setup routines to be methods. END K 10 svn:author V 3 imp K 8 svn:date V 27 2012-07-31T04:09:27.755280Z K 7 svn:log V 34 macb doesn't work, switch to ate. END K 10 svn:author V 4 fjoe K 8 svn:date V 27 2012-07-31T05:23:23.595616Z K 7 svn:log V 208 - Change back "d_ofs" to int8_t to not pessimize padding and size of "struct puc_cfg". - Use "puc_config_moxa" for Moxa boards that need d_ofs greater than 0x7f Prodded by: marcel@, gavin@ MFC after: 3 days END K 10 svn:author V 2 bz K 8 svn:date V 27 2012-07-31T05:34:54.297826Z K 7 svn:log V 155 Improve the should-never-hit printf to ease debugging in case we'd ever hit it again when doing the delayed IPv6 checksum calculations. MFC after: 3 days END K 10 svn:author V 2 bz K 8 svn:date V 27 2012-07-31T05:44:03.219491Z K 7 svn:log V 175 Properly apply #ifdef INET and leave a comment that we are (will) apply delayed IPv6 checksum processing in ip6_output.c when doing IPsec. PR: kern/170116 MFC after: 3 days END K 10 svn:author V 7 davidxu K 8 svn:date V 27 2012-07-31T05:48:35.618398Z K 7 svn:log V 1312 I am comparing current pipe code with the one in 8.3-STABLE r236165, I found 8.3 is a history BSD version using socket to implement FIFO pipe, it uses per-file seqcount to compare with writer generation stored in per-pipe object. The concept is after all writers are gone, the pipe enters next generation, all old readers have not closed the pipe should get the indication that the pipe is disconnected, result is they should get EPIPE, SIGPIPE or get POLLHUP in poll(). But newcomer should not know that previous writters were gone, it should treat it as a fresh session. I am trying to bring back FIFO pipe to history behavior. It is still unclear that if single EOF flag can represent SBS_CANTSENDMORE and SBS_CANTRCVMORE which socket-based version is using, but I have run the poll regression test in tool directory, output is same as the one on 8.3-STABLE now. I think the output "not ok 18 FIFO state 6b: poll result 0 expected 1. expected POLLHUP; got 0" might be bogus, because newcomer should not know that old writers were gone. I got the same behavior on Linux. Our implementation always return POLLIN for disconnected pipe even it should return POLLHUP, but I think it is not wise to remove POLLIN for compatible reason, this is our history behavior. Regression test: /usr/src/tools/regression/poll END K 10 svn:author V 5 luigi K 8 svn:date V 27 2012-07-31T05:51:48.139713Z K 7 svn:log V 34 remove a redundant MALLOC_DECLARE END K 10 svn:author V 9 monthadar K 8 svn:date V 27 2012-07-31T07:22:50.820654Z K 7 svn:log V 262 Fix wtap to not panic in wtap_beacon_intrp. * Changed KASSERT to be debug printf (DWTAP_PRINTF). If state is not IEEE80211_S_RUN we return without scheduling a new callout; * When net80211 stack changes state to IEEE802_11_INIT we stop the beacon callout task; END K 10 svn:author V 9 monthadar K 8 svn:date V 27 2012-07-31T07:31:47.923147Z K 7 svn:log V 278 Fix bugs in net80211s found with wtap simulator. For description of the test scripts refer to projects/net80211_testsuite/wtap. * Test 007 showed a bug in intermediate PREP for a proxy entry. Resolved; * Test 002 showed a bug in the Addressing Mode flag for a PREQ. Resolved; END K 10 svn:author V 9 monthadar K 8 svn:date V 27 2012-07-31T07:36:27.433689Z K 7 svn:log V 315 Fix a PREQ comparison error in 11s HWMP. * Earlier we compared two not equal metrics, one was what we recevied in the 'new PREQ' while the other was what we already have saved which was 'old PREQ' + link metric for the last hop; * Fixed by adding 'new PREQ' + link metric for the last hop in a temporary variable; END K 10 svn:author V 5 luigi K 8 svn:date V 27 2012-07-31T08:04:49.087215Z K 7 svn:log V 166 nobody uses this file except the userspace ipfw code, but the cast of a pointer to an integer needs a cast to prevent a warning for size mismatch. MFC after: 1 week END K 10 svn:author V 9 monthadar K 8 svn:date V 27 2012-07-31T08:05:40.647951Z K 7 svn:log V 43 Fixed some debug output in hwmp_recv_prep. END K 10 svn:author V 3 mav K 8 svn:date V 27 2012-07-31T10:58:50.680460Z K 7 svn:log V 1071 Add several performance optimizations to acpi_cpu_idle(). For C1 and C2 states use cpu_ticks() to measure sleep time instead of much slower ACPI timer. We can't do it for C3, as TSC may stop there. But it is less important there as wake up latency is high any way. For C1 and C2 states do not check/clear bus mastering activity status, as it is important only for C3. As side effect it can make CPU enter C2 instead of C3 if last BM activity was two sleeps back (unlike one before), but that may be even good because of collecting more statistics. Premature BM wakeup from C3, entered because of overestimation, can easily be worse then entering C2 from both performance and power consumption points of view. Together on dual Xeon E5645 system on sequential 512 bytes read test this change makes cpu_idle_acpi() as fast as simplest cpu_idle_hlt() and only few percents slower then cpu_idle_mwait(), while deeper states are still actively used during idle periods. To help with diagnostics, add C-state type into dev.cpu.X.cx_supported. Sponsored by: iXsystems, Inc. END K 10 svn:author V 6 cherry K 8 svn:date V 27 2012-07-31T11:16:19.474434Z K 7 svn:log V 14 MFC @ r238912 END K 10 svn:author V 7 glebius K 8 svn:date V 27 2012-07-31T11:31:12.168763Z K 7 svn:log V 86 Some style(9) and whitespace changes. Together with: Andrey Zonov END K 10 svn:author V 9 monthadar K 8 svn:date V 27 2012-07-31T13:11:20.967024Z K 7 svn:log V 59 Modified test 9 to test ping between each node at the end. END K 10 svn:author V 6 adrian K 8 svn:date V 27 2012-07-31T16:41:09.030654Z K 7 svn:log V 875 Push the rate control and descriptor chaining into the descriptor "set" functions, for both legacy and 802.11n. This will simplify supporting the EDMA chipsets as these two descriptor setup functions can just be overridden in their entirety, hiding all of the subtle differences in setting things up. It's not a permanent solution, as eventually the AR5416 HAL should grow similar versions of the 11n descriptor functions and then those can be used. TODO: * Push the "clr11naggr" call into the legacy setds, just to ensure that retried frames don't end up with the aggregate bits set inappropriately; * Remove the "setlasttxdesc" call from the 11n TX path and push it into setds_11n. * Ensure that setds_11n will work correctly for non-aggregate frames; * .. and then when it does, just unconditionally call "setds_11n" for 11n NICs and "setds" for non-11n NICs. END K 10 svn:author V 6 jilles K 8 svn:date V 27 2012-07-31T16:55:41.785373Z K 7 svn:log V 77 find: Remove unnecessary and inconsistent initialization. Submitted by: jhb END K 10 svn:author V 6 adrian K 8 svn:date V 27 2012-07-31T17:08:29.177944Z K 7 svn:log V 1347 Shuffle the call to ath_hal_setuplasttxdesc() to _after_ the rate control code is called and remove it from ath_buf_set_rate(). For the legacy (non-11n API) TX routines, ath_hal_filltxdesc() takes care of setting up the intermediary and final descriptors right, complete with copying the rate control info into the final descriptor so the rate modules can grab it. The 11n version doesn't do this - ath_hal_chaintxdesc() doesn't copy the rate control bits over, nor does it clear isaggr/moreaggr/ pad delimiters. So the call to setuplasttxdesc() is needed here. So: * legacy NICs - never call the 11n rate control stuff, so filltxdesc copies the rate control info right; * 11n NICs transmitting legacy or 11n non-aggregate frames - ath_hal_set11nratescenario() is called to setup rate control and then ath_hal_filltxdesc() chains them together - so the rate control info is right; * 11n aggregate frames - set11nratescenario() is called, then ath_hal_chaintxdesc() is called to chain a list of aggregate and subframes together. This requires a call to ath_hal_setuplasttxdesc() to complete things. Tested: * AR9280 in station mode TODO: * I really should make sure that the descriptor contents get blanked out correctly or garbage left over from aggregate frames may show up in non-aggregate frames, leading to badness. END K 10 svn:author V 2 mm K 8 svn:date V 27 2012-07-31T17:28:28.992835Z K 7 svn:log V 63 Fix reporting of root pool upgrade notice. MFC after: 2 weeks END K 10 svn:author V 2 mm K 8 svn:date V 27 2012-07-31T17:32:28.462238Z K 7 svn:log V 635 Fix wrong indent according to style(9) MFC after: 2 weeks > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. M zpool_main.c END K 10 svn:author V 3 jhb K 8 svn:date V 27 2012-07-31T18:25:00.712869Z K 7 svn:log V 1107 Reorder the managament of advisory locks on open files so that the advisory lock is obtained before the write count is increased during open() and the lock is released after the write count is decreased during close(). The first change closes a race where an open() that will block with O_SHLOCK or O_EXLOCK can increase the write count while it waits. If the process holding the current lock on the file then tries to call exec() on the file it has locked, it can fail with ETXTBUSY even though the advisory lock is preventing other threads from succesfully completeing a writable open(). The second change closes a race where a read-only open() with O_SHLOCK or O_EXLOCK may return successfully while the write count is non-zero due to another descriptor that had the advisory lock and was blocking the open() still being in the process of closing. If the process that completed the open() then attempts to call exec() on the file it locked, it can fail with ETXTBUSY even though the other process that held a write lock has closed the file and released the lock. Reviewed by: kib MFC after: 1 month END K 10 svn:author V 3 jfv K 8 svn:date V 27 2012-07-31T18:44:10.245477Z K 7 svn:log V 130 Clean up some unused leftover code from em Make IRQ style a tuneable Fix lock handling in the interrupt handler MFC after:3 days END K 10 svn:author V 6 adrian K 8 svn:date V 27 2012-07-31T18:47:17.318907Z K 7 svn:log V 282 Restore the PCI bridge configuration upon resume. This allows my TI1510 cardbus/PCI bridge to work after a suspend/resume, without having to unload/reload the cbb driver. I've also tested this on stable/9. I'll MFC it shortly. PR: kern/170058 Reviewed by: jhb MFC after: 1 day END K 10 svn:author V 3 imp K 8 svn:date V 27 2012-07-31T19:14:22.006813Z K 7 svn:log V 80 Allow chip selects other than 0. The SAM9260EK board has its dataflash on CS1. END K 10 svn:author V 3 imp K 8 svn:date V 27 2012-07-31T19:39:21.187638Z K 7 svn:log V 35 Note about where we can boot this. END K 10 svn:author V 3 imp K 8 svn:date V 27 2012-07-31T19:41:12.385852Z K 7 svn:log V 93 Prefer ate over macb. macb doesn't work anymore, and ate has more errata workarounds in it. END K 10 svn:author V 5 jceel K 8 svn:date V 27 2012-07-31T22:24:44.614253Z K 7 svn:log V 144 * Apply pmap_devmap enhancements to ARMv6 pmap. * Fix setting sc->gic_dev in GIC driver * Apply execute bit to vectors page (relevant on ARMv6) END K 10 svn:author V 5 jceel K 8 svn:date V 27 2012-07-31T22:25:29.667420Z K 7 svn:log V 32 Make PANDABOARD use early_uart. END K 10 svn:author V 2 bz K 8 svn:date V 27 2012-07-31T23:34:06.984724Z K 7 svn:log V 253 In case of IPsec he have to do delayed checksum calculations before adding any extension header, or rather before calling into IPsec processing as we may send the packet and not return to IPv6 output processing here. PR: kern/170116 MFC After: 3 days END K 10 svn:author V 6 adrian K 8 svn:date V 27 2012-07-31T23:54:15.822003Z K 7 svn:log V 395 Allow 802.11n hardware to support multi-rate retry when RTS/CTS is enabled. The legacy (pre-802.11n) hardware doesn't support this - although the AR5212 era hardware supports MRR, it doesn't have all the bits needed to support MRR + RTS/CTS. The AR5416 and later support a packet duration and RTS/CTS flags per rate scenario, so we should support it. Tested: * AR9280, STA PR: kern/170302 END K 10 svn:author V 6 adrian K 8 svn:date V 27 2012-08-01T00:18:02.609439Z K 7 svn:log V 54 Fix a case of "mis-located braces". PR: kern/170302 END K 10 svn:author V 7 delphij K 8 svn:date V 27 2012-08-01T00:21:55.523131Z K 7 svn:log V 14 Use calloc(). END K 10 svn:author V 7 delphij K 8 svn:date V 27 2012-08-01T00:36:12.018244Z K 7 svn:log V 47 Teach md5(1) about sha512. MFC after: 1 month END K 10 svn:author V 3 imp K 8 svn:date V 27 2012-08-01T01:18:36.571491Z K 7 svn:log V 26 Add the chip select glue. END K 10 svn:author V 6 grehan K 8 svn:date V 27 2012-08-01T05:53:20.609645Z K 7 svn:log V 237 Bump up the heap size to 1MB. With a few kernel modules, libstand zalloc and userboot seem to want to use ~600KB of heap space, which results in a segfault when malloc fails in bhyveload. Reported by: sree dot openwrk at gmail dot com END K 10 svn:author V 7 glebius K 8 svn:date V 27 2012-08-01T09:00:26.335336Z K 7 svn:log V 30 Some more whitespace cleanup. END K 10 svn:author V 3 des K 8 svn:date V 27 2012-08-01T09:10:21.678299Z K 7 svn:log V 112 Restore a piece of BSD history. PR: 169127 Submitted by: Ruben de Groot MFC after: 1 week END K 10 svn:author V 3 mav K 8 svn:date V 27 2012-08-01T12:24:13.513671Z K 7 svn:log V 222 Fix kernel panic on `camcontrol reset` for specific target, caused by uninitialized cm_targ in mpssas_action_resetdev(). Reviewed by: Desai, Kashyap Sponsored by: iXsystems, Inc. MFC after: 3 days END K 10 svn:author V 3 alc K 8 svn:date V 27 2012-08-01T16:04:13.094947Z K 7 svn:log V 801 Revise pmap_enter()'s handling of mapping updates that change the PTE's PG_M and PG_RW bits but not the physical page frame. First, only perform vm_page_dirty() on a managed vm_page when the PG_M bit is being cleared. If the updated PTE continues to have PG_M set, then there is no requirement to perform vm_page_dirty(). Second, flush the mapping from the TLB when PG_M alone is cleared, not just when PG_M and PG_RW are cleared. Otherwise, a stale TLB entry may stop PG_M from being set again on the next store to the virtual page. However, since the vm_page's dirty field already shows the physical page as being dirty, no actual harm comes from the PG_M bit not being set. Nonetheless, it is potentially confusing to someone expecting to see the PTE change after a store to the virtual page. END K 10 svn:author V 5 jceel K 8 svn:date V 27 2012-08-01T16:32:44.174025Z K 7 svn:log V 220 Introduce pmap_kenter_device() function for device mappings which uses correct mapping type on armv6 and behaves identically to pmap_kenter_nocache() on armv5. Chance bus_space_map() default implementation to use above. END K 10 svn:author V 3 kib K 8 svn:date V 27 2012-08-01T17:24:53.583256Z K 7 svn:log V 33 Add lfence(). MFC after: 1 week END K 10 svn:author V 3 kib K 8 svn:date V 27 2012-08-01T17:26:22.529836Z K 7 svn:log V 4786 diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index c253a96..3d8bd30 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -82,7 +82,11 @@ static void tsc_freq_changed(void *arg, const struct cf_level *level, static void tsc_freq_changing(void *arg, const struct cf_level *level, int *status); static unsigned tsc_get_timecount(struct timecounter *tc); -static unsigned tsc_get_timecount_low(struct timecounter *tc); +static inline unsigned tsc_get_timecount_low(struct timecounter *tc); +static unsigned tsc_get_timecount_lfence(struct timecounter *tc); +static unsigned tsc_get_timecount_low_lfence(struct timecounter *tc); +static unsigned tsc_get_timecount_mfence(struct timecounter *tc); +static unsigned tsc_get_timecount_low_mfence(struct timecounter *tc); static void tsc_levels_changed(void *arg, int unit); static struct timecounter tsc_timecounter = { @@ -262,6 +266,10 @@ probe_tsc_freq(void) (vm_guest == VM_GUEST_NO && CPUID_TO_FAMILY(cpu_id) >= 0x10)) tsc_is_invariant = 1; + if (cpu_feature & CPUID_SSE2) { + tsc_timecounter.tc_get_timecount = + tsc_get_timecount_mfence; + } break; case CPU_VENDOR_INTEL: if ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || @@ -271,6 +279,10 @@ probe_tsc_freq(void) (CPUID_TO_FAMILY(cpu_id) == 0xf && CPUID_TO_MODEL(cpu_id) >= 0x3)))) tsc_is_invariant = 1; + if (cpu_feature & CPUID_SSE2) { + tsc_timecounter.tc_get_timecount = + tsc_get_timecount_lfence; + } break; case CPU_VENDOR_CENTAUR: if (vm_guest == VM_GUEST_NO && @@ -278,6 +290,10 @@ probe_tsc_freq(void) CPUID_TO_MODEL(cpu_id) >= 0xf && (rdmsr(0x1203) & 0x100000000ULL) == 0) tsc_is_invariant = 1; + if (cpu_feature & CPUID_SSE2) { + tsc_timecounter.tc_get_timecount = + tsc_get_timecount_lfence; + } break; } @@ -328,16 +344,31 @@ init_TSC(void) #ifdef SMP -/* rmb is required here because rdtsc is not a serializing instruction. */ -#define TSC_READ(x) \ -static void \ -tsc_read_##x(void *arg) \ -{ \ - uint32_t *tsc = arg; \ - u_int cpu = PCPU_GET(cpuid); \ - \ - rmb(); \ - tsc[cpu * 3 + x] = rdtsc32(); \ +/* + * RDTSC is not a serializing instruction, and does not drain + * instruction stream, so we need to drain the stream before executing + * it. It could be fixed by use of RDTSCP, except the instruction is + * not available everywhere. + * + * Use CPUID for draining in the boot-time SMP constistency test. The + * timecounters use MFENCE for AMD CPUs, and LFENCE for others (Intel + * and VIA) when SSE2 is present, and nothing on older machines which + * also do not issue RDTSC prematurely. There, testing for SSE2 and + * vendor is too cumbersome, and we learn about TSC presence from + * CPUID. + * + * Do not use do_cpuid(), since we do not need CPUID results, which + * have to be written into memory with do_cpuid(). + */ +#define TSC_READ(x) \ +static void \ +tsc_read_##x(void *arg) \ +{ \ + uint32_t *tsc = arg; \ + u_int cpu = PCPU_GET(cpuid); \ + \ + __asm __volatile("cpuid" : : : "eax", "ebx", "ecx", "edx"); \ + tsc[cpu * 3 + x] = rdtsc32(); \ } TSC_READ(0) TSC_READ(1) @@ -487,7 +518,16 @@ init: for (shift = 0; shift < 31 && (tsc_freq >> shift) > max_freq; shift++) ; if (shift > 0) { - tsc_timecounter.tc_get_timecount = tsc_get_timecount_low; + if (cpu_feature & CPUID_SSE2) { + if (cpu_vendor_id == CPU_VENDOR_AMD) { + tsc_timecounter.tc_get_timecount = + tsc_get_timecount_low_mfence; + } else { + tsc_timecounter.tc_get_timecount = + tsc_get_timecount_low_lfence; + } + } else + tsc_timecounter.tc_get_timecount = tsc_get_timecount_low; tsc_timecounter.tc_name = "TSC-low"; if (bootverbose) printf("TSC timecounter discards lower %d bit(s)\n", @@ -599,16 +639,48 @@ tsc_get_timecount(struct timecounter *tc __unused) return (rdtsc32()); } -static u_int +static inline u_int tsc_get_timecount_low(struct timecounter *tc) { uint32_t rv; __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" - : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); + : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); return (rv); } +static u_int +tsc_get_timecount_lfence(struct timecounter *tc __unused) +{ + + lfence(); + return (rdtsc32()); +} + +static u_int +tsc_get_timecount_low_lfence(struct timecounter *tc) +{ + + lfence(); + return (tsc_get_timecount_low(tc)); +} + +static u_int +tsc_get_timecount_mfence(struct timecounter *tc __unused) +{ + + mfence(); + return (rdtsc32()); +} + +static u_int +tsc_get_timecount_low_mfence(struct timecounter *tc) +{ + + mfence(); + return (tsc_get_timecount_low(tc)); +} + uint32_t cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th) { END K 10 svn:author V 3 mav K 8 svn:date V 27 2012-08-01T17:31:31.390949Z K 7 svn:log V 607 Several fixes to allow firmware/BIOS flash access from user-level: - remove special handling of zero length transfers in mpi_pre_fw_upload(); - add missing MPS_CM_FLAGS_DATAIN flag in mpi_pre_fw_upload(); - move mps_user_setup_request() call into proper place; - increase user command timeout from 30 to 60 seconds; - avoid NULL dereference panic in case of firmware crash. Set max DMA segment size to 24bit, as MPI SGE supports it. Use mps_add_dmaseg() to add empty SGE instead of custom code. Tune endianness safety. Reviewed by: Desai, Kashyap Sponsored by: iXsystems, Inc. END K 10 svn:author V 3 kib K 8 svn:date V 27 2012-08-01T17:34:43.620792Z K 7 svn:log V 989 Do a trivial reformatting of the comment, to record the proper commit message for r238973: Rdtsc instruction is not synchronized, it seems on some Intel cores it can bypass even the locked instructions. As a result, rdtsc executed on different cores may return unordered TSC values even when the rdtsc appearance in the instruction sequences is provably ordered. Similarly to what has been done in r238755 for TSC synchronization test, add explicit fences right before rdtsc in the timecounters 'get' functions. Intel recommends to use LFENCE, while AMD refers to MFENCE. For VIA follow what Linux does and use LFENCE. With this change, I see no reordered reads of TSC on Nehalem. Change the rmb() to inlined CPUID in the SMP TSC synchronization test. On i386, locked instruction is used for rmb(), and as noted earlier, it is not enough. Since i386 machine may not support SSE2, do simplest possible synchronization with CPUID. MFC after: 1 week Discussed with: avg, bde, jkim END K 10 svn:author V 8 bdrewery K 8 svn:date V 27 2012-08-01T17:48:38.868084Z K 7 svn:log V 117 - Add myself to calendar.freebsd - Add my mentor relationships to committers-ports.dot Approved by: eadler (mentor) END K 10 svn:author V 5 luigi K 8 svn:date V 27 2012-08-01T18:49:00.654152Z K 7 svn:log V 106 add a cast to avoid a signed/unsigned warning (to be removed when we will have TUNABLE_UINT constructors) END K 10 svn:author V 5 luigi K 8 svn:date V 27 2012-08-01T18:52:07.643083Z K 7 svn:log V 297 replace inet_ntoa_r with the more standard inet_ntop(). As discussed on -current, inet_ntoa_r() is non standard, has different arguments in userspace and kernel, and almost unused (no clients in userspace, only net/flowtable.c, net/if_llatbl.c, netinet/in_pcb.c, netinet/tcp_subr.c in the kernel) END K 10 svn:author V 3 gnn K 8 svn:date V 27 2012-08-01T19:27:12.839281Z K 7 svn:log V 171 When we return with an error we cannot unlock the mutex, because it's been freed. Protect against that, hopefully unlikely, case. Reviewed by: rpaulo MFC after: 2 weeks END K 10 svn:author V 6 avatar K 8 svn:date V 27 2012-08-01T23:05:57.225671Z K 7 svn:log V 1000 Just like the other file systems found in /sys/fs, g_vfs_open() should be paried with g_vfs_close(). Though g_vfs_close() is a wrapper around g_wither_geom_close(), r206130 added the following test in g_vfs_open(): if (bo->bo_private != vp) return (EBUSY); Which will cause a 'Device busy' error inside reiserfs_mountfs() if the same file system is re-mounted again after umount or mounting failure: (case 1, /dev/ad4s3 is not a valid REISERFS partition) # mount -t reiserfs -o ro /dev/ad4s3 /mnt mount: /dev/ad4s3: Invalid argument # mount -t msdosfs -o ro /dev/ad4s3 /mnt mount: /dev/ad4s3: Device busy (case 2, /dev/ad4s3 is a valid REISERFS partition) # mount -t reiserfs -o ro /dev/ad4s3 /mnt # umount /mnt # mount -t reiserfs -o ro /dev/ad4s3 /mnt mount: /dev/ad4s3: Device busy On the other hand, g_vfs_close() 'fixed' the above cases by doing an extra step to keep 'sc->sc_bo->bo_private' and 'cp->private' pointers synchronised. Reviewed by: kib MFC after: 1 month END K 10 svn:author V 6 sbruno K 8 svn:date V 27 2012-08-02T00:00:34.830455Z K 7 svn:log V 280 CPU_NEXT() already handles wrapping around to the beginning. Also, in a system with sparse CPU IDs, you can have a valid CPU ID > mp_ncpus (e.g. if you have two CPUs 0 and 4, with mp_maxid == 4 and mp_ncpus == 2). Introduced at svn r235210 Submitted by: jhb@ Reviewed by: jfv@ END K 10 svn:author V 5 luigi K 8 svn:date V 27 2012-08-02T07:35:40.486356Z K 7 svn:log V 107 Add a newline on an error message; rename linux functions to avoid confusion; fix error reporting on linux END K 10 svn:author V 5 luigi K 8 svn:date V 27 2012-08-02T08:46:08.380092Z K 7 svn:log V 107 Update netmap page, fixing the API documentation and usage example. Add a new manpage for the vale switch END K 10 svn:author V 3 kib K 8 svn:date V 27 2012-08-02T10:39:54.487268Z K 7 svn:log V 315 fsck_ffs shall accept the configured journal size, and not refuse to operate on it if journal size is greater then SUJ_MAX. The later constant is only to select maximal journal size when user did not specified size explicitely. Submitted by: Andrey Zonov Reviewed by: mckusick MFC after: 1 week END K 10 svn:author V 5 luigi K 8 svn:date V 27 2012-08-02T11:59:43.260574Z K 7 svn:log V 146 fix some signed/unsigned warnings in the netmap code. Unfortunately the original drivers still have a lot of sign conversion/comparison warnings. END K 10 svn:author V 4 joel K 8 svn:date V 27 2012-08-02T12:16:46.052309Z K 7 svn:log V 42 mdoc: remove superfluous paragraph macro. END K 10 svn:author V 4 joel K 8 svn:date V 27 2012-08-02T12:17:52.738607Z K 7 svn:log V 28 Remove trailing whitespace. END K 10 svn:author V 5 luigi K 8 svn:date V 27 2012-08-02T12:45:13.664907Z K 7 svn:log V 86 replace __unused with a portable construct; fix a couple of signed/unsigned warnings. END K 10 svn:author V 7 glebius K 8 svn:date V 27 2012-08-02T13:20:44.894337Z K 7 svn:log V 185 The llentry_update() is used only by flowtable and the latter always passes NULL pointer to it. Thus, code can be simplified and function renamed to llentry_alloc() to match rtalloc(). END K 10 svn:author V 7 glebius K 8 svn:date V 27 2012-08-02T13:57:49.826187Z K 7 svn:log V 958 Fix races between in_lltable_prefix_free(), lla_lookup(), llentry_free() and arptimer(): o Use callout_init_rw() for lle timeout, this allows us safely disestablish them. - This allows us to simplify the arptimer() and make it race safe. o Consistently use ifp->if_afdata_lock to lock access to linked lists in the lle hashes. o Introduce new lle flag LLE_LINKED, which marks an entry that is attached to the hash. - Use LLE_LINKED to avoid double unlinking via consequent calls to llentry_free(). - Mark lle with LLE_DELETED via |= operation istead of =, so that other flags won't be lost. o Make LLE_ADDREF(), LLE_REMREF() and LLE_FREE_LOCKED() more consistent and provide more informative KASSERTs. The patch is a collaborative work of all submitters and myself. PR: kern/165863 Submitted by: Andrey Zonov Submitted by: Ryan Stone Submitted by: Eric van Gyzen END K 10 svn:author V 2 jh K 8 svn:date V 27 2012-08-02T15:05:34.241862Z K 7 svn:log V 155 Disallow sectorsize larger than MAXPHYS and mediasize smaller than sectorsize. PR: 169947 Submitted by: Filip Palian (original version) Reviewed by: kib END K 10 svn:author V 4 ache K 8 svn:date V 27 2012-08-02T15:13:12.273716Z K 7 svn:log V 354 MFC r238795 Try to avoid all files dependence on the modification time of the large and often modified directory created symbolic links points to - it cause unnecessary full rebuilds each time make runs when directory is changed. So do it only if symbolic link does not exists, which usually means that objdir is clean anyway. Approved by: re (kib) END K 10 svn:author V 6 adrian K 8 svn:date V 27 2012-08-02T20:14:45.532819Z K 7 svn:log V 484 Fix an issue that crept in with the previous descriptor tidyup. When forming aggregates, the last descriptor was now not being correctly setup - instead, the "setuplasttxdesc" call was being handed the first descriptor in the last subframe, rather than the last descriptor in the last subframe. This showed up as "bad series0 hwrate" messages, as the final descriptor just didn't have any of the rate control information squirreled away. Tested: * AR9280 STA -> 11n AP, iperf TCP END K 10 svn:author V 4 emax K 8 svn:date V 27 2012-08-02T20:48:22.791334Z K 7 svn:log V 130 MFC r238599 Return zero from get_addrselectpolicy() when no source-address-selection policy is installed. Approved by: re (kib) END K 10 svn:author V 4 emax K 8 svn:date V 27 2012-08-02T20:49:11.609375Z K 7 svn:log V 88 MFC r238622 Allow to specify no source-address-selection policy Approved by: re (kib) END K 10 svn:author V 6 brooks K 8 svn:date V 27 2012-08-02T20:54:59.514488Z K 7 svn:log V 33 Merge from head through r238992. END K 10 svn:author V 7 delphij K 8 svn:date V 27 2012-08-03T00:11:13.786503Z K 7 svn:log V 111 Correct a typo. Reported by: Sascha Wildner Reviewed by: scottl MFC after: 3 days END K 10 svn:author V 3 alc K 8 svn:date V 27 2012-08-03T01:48:15.801399Z K 7 svn:log V 175 Inline vm_page_aflags_clear() and vm_page_aflags_set(). Add comments stating that neither these functions nor the flags that they are used to manipulate are part of the KBI. END K 10 svn:author V 6 mjacob K 8 svn:date V 27 2012-08-03T03:30:49.707712Z K 7 svn:log V 4 MFC END