Commit Graph

172239 Commits

Author SHA1 Message Date
Konstantin Belousov
ee4116b8f7 For old mmap syscall, when executing on amd64 or ia64, enforce the
PROT_EXEC if prot is non-zero, process is 32bit and
kern.elf32.i386_read_exec syscal is enabled. This workaround is needed
for old i386 a.out binaries, where dynamic linker did not specified
PROT_EXEC for mapping of the text.

The kern.elf32.i386_read_exec MIB name looks weird for a.out binaries,
but I reused the existing knob which already has the needed semantic.

MFC after:	1 week
2012-08-14 12:11:48 +00:00
Konstantin Belousov
a8d4becf02 Regenerate. 2012-08-14 12:09:36 +00:00
Konstantin Belousov
f90fabce5a Implement the old mmap syscall for compat32, when COMPAT_43 option is
enabled. The syscall is used by FreeBSD 1.1.5.1 dynamic linker.

MFC after:	1 week
2012-08-14 12:09:09 +00:00
Konstantin Belousov
7707ccabfb Adjust the r205536, by allowing a non-zero offset for anonymous
mappings for a.out binaries. Apparently, a.out ld.so from FreeBSD
1.1.5.1 can issue such requests.

Reported and tested by:	Dan Plassche <dplassche@gmail.com>
MFC after:	1 week
2012-08-14 11:47:07 +00:00
Konstantin Belousov
b6c00483e9 Do not leave invalid pages in the object after the short read for a
network file systems (not only NFS proper). Short reads cause pages
other then the requested one, which were not filled by read response,
to stay invalid.

Change the vm_page_readahead_finish() interface to not take the error
code, but instead to make a decision to free or to (de)activate the
page only by its validity. As result, not requested invalid pages are
freed even if the read RPC indicated success.

Noted and reviewed by:	alc
MFC after:	1 week
2012-08-14 11:45:47 +00:00
Andreas Tobler
6e8fcacda4 Fix typo in comment. 2012-08-14 05:16:35 +00:00
John Baldwin
06e8730c59 Add locking to the twe(4) driver and make it MPSAFE:
- Add per-controller configuration (sx) and I/O (mutex) locks.  The
  configuration lock protects the relationship of volumes and drives
  while the I/O lock protects access to the controller's registers and
  the main I/O path.
- Remove some checks for M_WAITOK malloc()'s failing.
- Remove the explicit bus space tag/handle from the softc and use
  bus_*() rather than bus_space_*().
- Reuse the existing new-bus sysctl context instead of creating a
  new one.
- Remove compat shims for FreeBSD 4.x.
- Use pci_enable_busmaster() rather than doing it by hand, and rely
  on bus_alloc_resource() to enable PCI I/O decoding.

Tested by:	Mike Tancsa  mike sentex net
Reviewed by:	scottl (partially)
MFC after:	1 month
2012-08-13 21:29:34 +00:00
Dimitry Andric
6cad98e283 After r239066, reinitialize v86.ctl and v86.addr for int 13 EDD probing
in sys/boot/i386/libi386/biosdisk.c.  Otherwise, when DISK_DEBUG is
enabled, the DEBUG() macros will clobber those fields, and cause the
probing to always fail mysteriously when debugging is enabled.
2012-08-13 21:04:01 +00:00
Ed Maste
033ed050a0 Reword comment to try to improve clarity, and fix a typo. 2012-08-13 19:14:45 +00:00
John Baldwin
6e4ac34b07 Remove the deassert INIT IPI from the IPI startup sequence for APs.
It is not listed in the boot sequence in the MP specification (1.4),
and it is explicitly ignored on modern CPUs.  It was only ever required
when bootstrapping systems with external APICs (that is, SMP machines
with 486s), which FreeBSD has never supported (and never will).

While here, tidy some comments and remove some banal ones.
2012-08-13 18:52:51 +00:00
Hans Petter Selasky
f61fc4bd7d Fix for missing locks due to recent change.
PR:		usb/170606
MFC after:	2 weeks
2012-08-13 18:34:04 +00:00
Hans Petter Selasky
07b6ce3ba9 Add support for streams to LibUSB v2.0.
MFC after:	2 weeks
2012-08-13 18:10:52 +00:00
Hans Petter Selasky
e9cec01683 Rename new IOCTL to singular form of the noun "streams".
MFC after:	2 weeks
2012-08-13 18:09:19 +00:00
Hans Petter Selasky
0cb5abc7ca Improve auto-quirks detection for certain Kingston memory sticks.
MFC after:	2 weeks
2012-08-13 18:00:34 +00:00
Alan Cox
f167c4a762 Port the new PV entry allocator from amd64/i386. This allocator has two
advantages.  First, PV entries are roughly half the size.  Second, this
allocator doesn't access the paging queues, and thus it will allow for the
removal of the page queues lock from this pmap.

Fix a rather serious bug in pmap_remove_write().  After removing write
access from the specified page's first mapping, pmap_remove_write() then
used the wrong "next" pointer.  Consequently, the page's second, third,
etc. mappings were not write protected.

Tested by:	jchandra
2012-08-13 17:38:38 +00:00
John Baldwin
a4284ef768 Add a 10 millisecond delay after sending the initial INIT IPI. This
matches the algorithm in the MP specification (1.4).  Previously we
were sending out the deassert INIT IPI immediately after the initial
INIT IPI was sent.
2012-08-13 16:33:22 +00:00
Ed Maste
1221cc675d Use array notation for consistency. 2012-08-13 16:03:30 +00:00
Warren Block
44d8663ddb Correct description of minfree to kilobytes rather than blocks.
PR:		125921
Submitted by:	Andre Albsmeier <Andre.Albsmeier@siemens.com>
MFC after:	3 days
2012-08-13 15:16:25 +00:00
Andrey V. Elsukov
9131425146 Restore the old behaviour. If requested partition is a BSD slice,
but d_partition isn't explicitly set, then try to open BSD label and its
first partition.
2012-08-13 13:33:21 +00:00
Andrey V. Elsukov
baf3d8bfeb Remove colons from the debug message, device name returned by the
disk_fmtdev() already has the colons.
2012-08-13 13:10:50 +00:00
Andrey V. Elsukov
42b577fe76 Unbreak booting from the true dedicated disks.
When we open the disk, check the type of partition table, that has
been detected. If this is BSD label, then we assume this is DD mode.

Reported by:	dim@
2012-08-13 13:08:30 +00:00
Colin Percival
347c7fd7bf Build modules along with the XENHVM kernels.
No objections from:	freebsd-xen mailing list
MFC after:	1 week
2012-08-13 07:36:57 +00:00
Matt Jacob
64f202fc7d Remove extraneous newline.
MFC after:	1 month
2012-08-12 20:49:25 +00:00
Matt Jacob
405b7a2903 Fix an oops where we wiped out DMA maps. Don't allocate extended
command space for anything less than a 2300.

MFC after:	1 month
X-MFC:		238869
2012-08-12 20:45:47 +00:00
Glen Barber
e5561269e1 - Fix source dataset snapshot name in Example 15.
- Bump date.

MFC after:	3 days
X-MFC-With:	r239216
2012-08-12 20:30:15 +00:00
Glen Barber
c980404ee4 Remove a leading space that breaks rendering.
MFC after:	3 days
2012-08-12 20:23:59 +00:00
Hans Petter Selasky
a015554f40 Compile fix.
MFC after:	2 weeks
2012-08-12 19:58:56 +00:00
Hans Petter Selasky
a5cf1aaaff Add support for the so-called streams feature of BULK endpoints
in SUPER-speed mode, USB 3.0.

This feature has not been tested yet, due to lack of hardware.

This feature is useful when implementing protocols like UASP,
USB attached SCSI which promises higher USB mass storage throughput.

This patch also implements support for hardware processing of endpoints
for increased performance. The switching to hardware processing
of an endpoint is done via a callback to the USB controller driver. The
stream feature is implemented like a variant of a hardware USB protocol.

USB controller drivers implementing device mode needs to be updated to
implement the new "xfer_stall" USB controller method and remove the
"xfer" argument from the "set_stall" method.

The API's toward existing USB drivers are preserved. To setup a USB transfer
in stream mode, set the "stream_id" field of the USB config structure to
the desired value.

The maximum number of BULK streams is currently hardcoded and limited to 8
via a define in usb_freebsd.h.

All USB drivers should be re-compiled after this change.

LibUSB will be updated next week to support streams mode. A new IOCTL to
setup BULK streams as already been implemented. The ugen device nodes
currently only supports stream ID zero.

The FreeBSD version has been bumped.

MFC after:	2 weeks
2012-08-12 17:53:06 +00:00
Matt Jacob
5e6609a21a 1. Remove SEN support. I doubt there are any working examples
of this hardware still running (close to twenty years now).

2. Quiesece and use ENC_VLOG instead of ENC_LOG for most
complaints. That is, they're visible with bootverbose, but
otherwise quiesced and not repeatedly spamming messages
with constant reminders that hardware in this space is
rarely fully compliant.

MFC after:	1 month
2012-08-12 17:01:07 +00:00
Matt Jacob
10d4323996 Add missing VERIFY_10 definition.
MFC after:	1 month
2012-08-12 16:58:38 +00:00
Andrey V. Elsukov
777085904e Add another debug message. 2012-08-12 14:32:30 +00:00
Andrey V. Elsukov
e6232c0dea Add more debug messages. 2012-08-12 14:16:21 +00:00
David Xu
aa75bc577a Do defered mutex wakeup once. 2012-08-12 00:56:56 +00:00
Adrian Chadd
1762ec944a Revert the ath_tx_draintxq() method, and instead teach it the minimum
necessary to "do" EDMA.

It was just using the TX completion status for logging information about
the descriptor completion.  Since with EDMA we don't know this without
checking the TX completion FIFO, we can't provide this information.
So don't.
2012-08-12 00:46:15 +00:00
Adrian Chadd
788e6aa99c Break out ath_draintxq() into a method and un-methodize ath_tx_processq().
Now that I understand what's going on with this, I've realised that
it's going to be quite difficult to implement a processq method in
the EDMA case.  Because there's a separate TX status FIFO, I can't
just run processq() on each EDMA TXQ to see what's finished.
i have to actually run the TX status queue and handle individual
TXQs.

So:

* unmethodize ath_tx_processq();
* leave ath_tx_draintxq() as a method, as it only uses the completion status
  for debugging rather than actively completing the frames (ie, all frames
  here are failed);
* Methodize ath_draintxq().

The EDMA ath_draintxq() will have to take care of running the TX
completion FIFO before (potentially) freeing frames in the queue.

The only two places where ath_tx_draintxq() (on a single TXQ) are used:

* ath_draintxq(); and
* the CABQ handling in the beacon setup code - it drains the CABQ before
  populating the CABQ with frames for a new beacon (when doing multi-VAP
  operation.)

So it's quite possible that once I methodize the CABQ and beacon handling,
I can just drop ath_tx_draintxq() in its entirety.

Finally, it's also quite possible that I can remove ath_tx_draintxq()
in the future and just "teach" it to not check the status when doing
EDMA.
2012-08-12 00:37:29 +00:00
David Xu
d7f97db7bd Some style fixes inspired by @bde. 2012-08-11 23:48:39 +00:00
Adrian Chadd
e1252ce1d2 Extend the beacon code slightly to support AP mode beaconing for the
EDMA HAL hardware.

* The EDMA HAL code assumes the nexttbtt and intval values are in TU/8
  units, rather than TU.  For now, just "hack" around that here, at least
  until I code up something to translate it in the HAL.
* Setup some different TXQ flags for EDMA hardware.
* The EDMA HAL doesn't support setting the first rate series via
  ath_hal_setuptxdesc() - instead, a call to ath_hal_set11nratescenario()
  is always required.  So for now, just do an 11n rate series setup
  for EDMA beacon frames.

This allows my AR9380 to successfully transmit beacon frames.

However, CABQ TX and all normal data frame TX and TX completion is
still not functional and will require some more significant code churn
to make work.
2012-08-11 23:26:19 +00:00
David Xu
e220a13ab9 MFp4:
Further decreases unexpected context switches by defering mutex wakeup
until internal sleep queue lock is released.
2012-08-11 23:17:02 +00:00
Adrian Chadd
0655b67b3c Add the AR9380 HAL to the TX descriptor debugging, in order to dump all
of the descriptor contents.
2012-08-11 22:39:27 +00:00
Adrian Chadd
4ddf2cc38c Add the AR9300 HAL ID in to the 11n check routine.
I was having TX hang issues, which I root caused to having the
legacy ath_hal_setupxtxdesc() called, rather than the 11n rate scenario
setup code.  This meant that rate control information wasn't being
put into frames, causing the MAC to stall/hang.
2012-08-11 22:25:28 +00:00
Adrian Chadd
3ae723d459 Begin fleshing out the TX FIFO support.
* Add ATH_TXQ_FIRST() for easy tasting of what's on the list;
* Add an "axq_fifo_depth" for easy tracking of how deep the current
  FIFO is;
* Flesh out the handoff (mcast, hw) functions;
* Begin fleshing out a TX ISR proc, which tastes the TX status FIFO.

The legacy hardware stuffs the TX completion at the end of the final frame
descriptor (or final sub-frame when doing aggregate.)  So it's feasible
to do a per-TXQ drain and process, as the needed info is right there.

For EDMA hardware, there's a separate TX completion FIFO.  So the TX
process routine needs to read the single FIFO and then process the
frames in each hardware queue.

This makes it difficult to do a per-queue process, as you'll end up with
frames in the TX completion FIFO for a different TXQ to the one you've
passed to ath_tx_draintxq() or ath_tx_processq().

Testing:

I've tested the TX queue and TX completion code in hostap mode on an
AR9380.  Beacon frames successfully transmit and the completion routine
is called.  Occasional data frames end up in TXQ 1 and are also
successfully completed.

However, this requires some changes to the beacon code path as:

* The AR9380 beacon configuration API is now in TU/8, rather than
  TU;
* The AR9380 TX API requires the rate control is setup using a call
  to setup11nratescenario, rather than having the try0 series setup
  (rate/tries for the first series); so the beacon won't go out.

I'll follow this up with commits to the beacon code.
2012-08-11 22:20:28 +00:00
Alexander Motin
37f4e0254f Some more minor tunings inspired by bde@. 2012-08-11 20:24:39 +00:00
Dimitry Andric
f049a6cb4a Add __always_inline to __ieee754_rem_pio2() and __ieee754_rem_pio2f(),
since some older versions of gcc refuse to inline these otherwise.

Requested by:	bde
MFC after:	1 week
2012-08-11 15:47:22 +00:00
Alexander Motin
bf89d544d0 Allow idle threads to steal second threads from other cores on systems with
8 or more cores to improve utilization.  None of my tests on 2xXeon (2x6x2)
system shown any slowdown from mentioned "excess thrashing".  Same time in
pbzip2 test with number of threads more then number of CPUs I see up to 10%
speedup with SMT disabled and up 5% with SMT enabled.  Thinking about
trashing I was trying to limit that stealing within same last level cache,
but got only worse results.  Present code any way prefers to steal threads
from topologically closer cores.

Sponsored by:	iXsystems, Inc.
2012-08-11 15:08:19 +00:00
Ed Schouten
19c79bf86a Rename aux.c to auxv.c.
On Windows, AUX is the auxiliary device, usually pointing to COM1.
Therefore it is forbidden to create a file named aux.c. To make it a bit
easier for Windows users to check out our source code, rename this file
to auxv.c.

MFC after:	1 month
Discussed with:	kib
Suggested by:	Eric van Gyzen <eric vangyzen net>
2012-08-11 12:07:24 +00:00
Dimitry Andric
2b795b2921 Change a few extern inline functions in libm to static inline, since
they need to refer to static constants, which C99 does not allow for
extern inline functions.

While here, change a comment in e_rem_pio2f.c to mention the correct
number of bits.

Reviewed by:	bde
MFC after:	1 week
2012-08-11 11:13:48 +00:00
Andrew Turner
d2a3296d1a Move the decoding of the swi instruction to the syscall function. With the
ARM EABI the syscall value will be moved to a register to ease adding thumb
support. When this happens decoding of the instruction will no longer be
required.
2012-08-11 05:58:56 +00:00
Warner Losh
56c265f2f9 Correct the PLLA setting functions and centralize. 2012-08-11 05:45:19 +00:00
Warner Losh
bcc1a5425a Update comments about setting PLLA and refernce the tables in the
datasheet that express the limits.
2012-08-11 05:12:46 +00:00
Warner Losh
19b89339dc Don't use C++ comments. 2012-08-11 05:03:30 +00:00