198788 Commits

Author SHA1 Message Date
rakuco
489ab0737e MFC r281146.
bthidd: Remove unused macros from hid.c.

ASIZE() was never used, and min() stopped being used in r207812.

Differential Revision:	https://reviews.freebsd.org/D2230
Reviewed by:		emax
Approved by:		emax
2015-04-15 22:07:51 +00:00
rakuco
62386cb488 MFC r281116.
bthidd: Consider usage ranges when dealing with array inputs.

So far, we were always using HID_USAGE() to determine the Usage ID of a
certain HID report input item. This does not work as intended if a field
is an array and the allowed usages are specified with a usage range, as
HID_USAGE() will return 0. We need to use the field value as an index in
the usage range list in this case instead.

This makes the volume keys in a Microsoft Bluetooth Mobile Keyboard
5000 be properly recognized. The relevant part of the HID report looks
like this:

  0xA1, 0x01,        // Collection (Application)
  0x85, 0x07,        //   Report ID (7)
  0x05, 0x0C,        //   Usage Page (Consumer)
  0x19, 0x00,        //   Usage Minimum (Unassigned)
  0x2A, 0xFF, 0x03,  //   Usage Maximum (0x03FF)
  0x95, 0x01,        //   Report Count (1)
  0x75, 0x10,        //   Report Size (16)
  0x15, 0x00,        //   Logical Minimum (0)
  0x27, 0xFF, 0x03, 0x00, 0x00,  //   Logical Maximum (1023)
  0x81, 0x00,        //   Input (Data,Array,Abs,No Wrap,Linear,Preferred
                     //   State,No Null Position)

When a key such as "volume down" is pressed, the following data is
transferred through Interrupt In:

  0x07 0xEA 0x00

Differential Revision:	https://reviews.freebsd.org/D2229
2015-04-15 22:02:52 +00:00
slm
77f96f7deb MFI r257381:
Adjust to handle either a 32-bit or 64-bit lun_id_t in printf.

MFC r266615:
    Increase taskqueue thread priority from idle to PRIBIO.

MFC r279253:
    - Copyright to Avago
    - SSU changes
    - SATA ID timeout handling (PR 191348)
    - reset handling changes
    - Bump version to 20.00.00.00-fbsd

MFC r279695:
    Change that should have been done with r279253
2015-04-15 21:47:15 +00:00
jhb
5967aacd0b MFC 278325,280866:
Revert the IPI startup sequence to match what is described in the
Intel Multiprocessor Specification v1.4.  The Intel SDM claims that

278325:
Revert the IPI startup sequence to match what is described in the
Intel Multiprocessor Specification v1.4.  The Intel SDM claims that
the INIT IPIs here are invalid, but other systems follow the MP
spec instead.

While here, fix the IPI wait routine to accept a timeout in microseconds
instead of a raw spin count, and don't spin forever during AP startup.
Instead, panic if a STARTUP IPI is not delivered after 20 us.

280866:
Wait 100 microseconds for a local APIC to dispatch each startup-related IPI
rather than 20.  The MP 1.4 specification states in Appendix B.2:

  "A period of 20 microseconds should be sufficient for IPI dispatch to
   complete under normal operating conditions".

(Note that this appears to be separate from the 10 millisecond (INIT) and
200 microsecond (STARTUP) waits after the IPIs are dispatched.)  The
Intel SDM is silent on this issue as far as I can tell.

At least some hardware requires 60 microseconds as noted in the PR, so
bump this to 100 to be on the safe side.

PR:		196542, 197756
2015-04-15 16:52:34 +00:00
kib
dcb9c46825 MFC r281272:
Explain that vm_page_array is mapped to describe the memory, not the
memory itself.  Provide the formula to calculate the number of
required page tables.  Correct the size of the struct vm_page for
non-PAE case.
2015-04-15 06:59:53 +00:00
kib
57545f1ca4 MFC r281254:
Account for the offset of the page run when allocating the
dmar_map_entry.
2015-04-15 06:56:51 +00:00
dchagin
adf6ad45fa MFC r281162, r281451:
Use flexible array for per cpu uma_cache to avoid allocating
an extra struct uma_cache.

PR:		199169
2015-04-15 05:13:41 +00:00
jhb
887f061ed2 MFC 278474,278476,280279:
Expand the bitcount*() API and use it to implement CPU_COUNT for cpusets.

278474:
Use __builtin_popcnt() to implement a BIT_COUNT() operation for bitsets and
use this to implement CPU_COUNT() to count the number of CPUs in a cpuset.

278476:
Use __builtin_popcountl() instead of __builtin_popcount().

280279:
Expand the bitcount* API to support 64-bit integers, plain ints and longs
and create a "hidden" API that can be used in other system headers without
adding namespace pollution.
- If the POPCNT instruction is enabled at compile time, use
  __builtin_popcount*() to implement __bitcount*(), otherwise fall back
  to software implementations.
- Use the existing bitcount16() and bitcount32() from <sys/systm.h> to
  implement the non-POPCNT __bitcount16() and __bitcount32() in
  <sys/types.h>.
- For the non-POPCNT __bitcount64(), use a similar SWAR method on 64-bit
  systems.  For 32-bit systems, use two __bitcount32() operations on the
  two halves.
- Use __bitcount32() to provide a __bitcount() that operates on plain ints.
- Use either __bitcount32() or __bitcount64() to provide a
  __bitcountl() that operates on longs.
- Add public bitcount*() wrappers for __bitcount*() for use in the kernel
  in <sys/libkern.h>.
- Use __bitcountl() instead of __builtin_popcountl() in BIT_COUNT().
2015-04-14 20:05:26 +00:00
pfg
f3aa91c084 MFC r281181, r281182;
sort(1): Cleanups and a small memory leak.
Remove custom getdelim(3) and fix a small memory leak.

Obtained from:  OpenBSD
2015-04-14 18:57:50 +00:00
pfg
af53064a71 MFC r281320:
Update documented OEM string in newfs_msdos(8).

This was updated in r203868 to better match the naming scheme
in other OSs that use FAT.
2015-04-14 18:45:30 +00:00
mav
25a103ace6 MFC r281199: Remove hard limits on number of accepting NFS connections.
Limits of 5 connections set long ago creates problems for SPEC benchmark.
Make the NFS follow system-wide maximum.
2015-04-14 09:58:10 +00:00
delphij
edfb896790 MFC r280716,280767,280914:
- Correct type for checkAgainst.
 - Staticify flags that are not used outside the file scope.
 - Fix warnings.
 - Constify parameters.
2015-04-14 00:32:03 +00:00
delphij
0f18b563c9 MFC r266417 (bjk):
Assorted updates to md5.1

Note that the -c argument's parameter is compared against the digest of
the file, not the file. [1]

Update the "current time" parentheticals for notes about reversing
and colliding the hash functions. [1]

Some general mdoc updates.

PR:		docs/188043 [1]
Submitted by:	Jamie Landeg-Jones [1]
2015-04-14 00:27:54 +00:00
jkim
30e912566b MFC: r281335
Print 64-bit addresses clearly with leading zeros to avoid confusions.
2015-04-13 22:26:11 +00:00
jkim
0fda8f1c21 MFC: r281331
Do not crash when RSDT/XSDT contains an empty entry.
2015-04-13 22:22:32 +00:00
mav
66d912b92f MFC r281163: Make ctld to not exit on ECONNABORTED on accept().
That is not really an error for the main process.
2015-04-13 09:18:56 +00:00
mav
a76136eb76 MFC r280850:
Periodically wake up threads waiting for vmem(9) resources, so they could
ask for resource reclamation again.

This is kind of dirty hack, but as last resort this is better then stuck
indefinitely because of KVA fragmentation, waiting until some random event
free something sufficient.  OpenSolaris also has this hack in its vmem(9).
2015-04-13 09:17:57 +00:00
peter
c8a0a7a3f7 MFC r268182: Initialize page sizes early for ia64. 2015-04-13 08:35:03 +00:00
markj
b4c145b73c MFC r280834:
Bound the number of frames traversed when executing the ustackdepth action.
2015-04-13 01:42:24 +00:00
rpaulo
14c57b50a3 MFC r281136:
ichsmb: add a device id for the Wildcat Point-LP.
2015-04-13 01:19:22 +00:00
eadler
2f2ff70a0d MFC r281383:
iwn, wlan: fix typos
	Fxi tow typos
2015-04-13 01:01:17 +00:00
markj
a0a30f026e MFC r279862:
Fix a possible infinite loop in ctf_discard().

MFC r279864:
Use CTF_TYPE_TO_INDEX when comparing type indices to the dynamic type
threshold.

MFC r279869:
If the destination container contains only a forward declaration for the
input type in ctf_add_type(), search its dynamic type list before adding
a new type.
2015-04-12 21:45:34 +00:00
markj
d81fd232dc MFC r280882:
Fix a misparenthesization that could cause a crash if TERM is not set.
2015-04-12 21:38:18 +00:00
markj
6a076d8809 MFC r278114:
libdtrace: Let the standard deviation of the empty set be 0.

PR:	197260
2015-04-12 21:35:13 +00:00
markj
6c5bc954a5 MFC r280998:
arp(8): add support for printing and deleting entries of type
IFT_INFINIBAND, used in IPoIB.

PR:	151594
2015-04-12 21:28:54 +00:00
dchagin
75ef967474 MFC r281113:
Fix wrong kassert msg in uma.

PR:           199172
2015-04-12 07:24:10 +00:00
kib
1d6a22da62 MFC r281121:
Do not call msdosfs_sync() on the read-only msdosfs mounts.

PR:    199152
2015-04-12 07:05:20 +00:00
kib
cf6596d5ab MFC r281120:
Assert that an msdosfs mount is not read-only when FAT modifications
are requested.
2015-04-12 07:03:26 +00:00
kib
6135eb6231 MFC r280819:
Formatting changes to the pthread_testcancel(3).
2015-04-12 06:54:53 +00:00
kib
d47c2f0941 MFC r280818:
Make kevent(2) a cancellation point.
2015-04-12 06:52:43 +00:00
kib
3937204485 MFC r280816:
Change default visibility for rtld to hidden, on x86.
2015-04-12 06:45:40 +00:00
kib
0fe937192c MFC r264346 (by alc):
Pass MAP_ALIGNED_SUPER to allocate the whole dso region if its text is large
enough for the superpage mapping.
2015-04-12 06:43:13 +00:00
jpaetzel
9455179208 MFC 281112, 281166
Bug fixes and feature adds

- Remove extranious echo that breaks puppet
- Handle restarts of multiple pflog devices correctly
- Add the ability to perform actions on specific pflog devices.

Typo Fix.

PR:	199150
2015-04-12 01:14:43 +00:00
rpaulo
aa0bc49330 MFC r281070:
urtwn: blink the LED when scanning.
2015-04-11 02:23:59 +00:00
jkim
9b23137acc MFC: r281171
Tidy up battery status information.  Remove a trailing white space.

PR:		193671
2015-04-11 01:17:19 +00:00
rmacklem
3c334aaa55 MFC: r276347
r245508 modified the NFS client's Setattr RPC to
use VA_UTIMES_NULL to indicate whether it should
set the time to the current tod on the server.
This had the side effect of making the NFS client
use the client's timestamp for exclusive create,
starting with FreeBSD9.2.
Unfortunately a bug in some Solaris NFS servers
causes these servers to return NFS_OK to the
Setattr RPC done during exclusive create, but not
actually set the file's mode, leaving the file's
mode == 0.
This patch restores the NFS client's behaviour to
use the server's tod for the exclusive open's
Setattr RPC, to avoid the Solaris server bug and
to restore the pre-FreeBSD9.2 NFS behaviour.
2015-04-10 23:43:01 +00:00
dim
7f3b476176 MFC r272814 (by bapt):
Add OBJCOPY to the list of external tools

MFC r272815 (by bapt):

  Fix typo

This should fix the build troubles some people have been seeing after
the MFC of r280980 (in r281289).  Sorry for the breakage.
2015-04-10 20:38:31 +00:00
kib
6b6e486121 MFC r280760:
Fix the hand after the immediate reboot after the init binary is unlinked.

MFC r280763:
Fix build (with gcc).
2015-04-10 02:23:44 +00:00
mav
036979b3f8 MFC r280757: Remove request sorting from GEOM_MIRROR and GEOM_RAID.
When CPU is not busy, those queues are typically empty.  When CPU is busy,
then one more extra sorting is the last thing it needs.  If specific device
(HDD) really needs sorting, then it will be done later by CAM.

This supposed to fix livelock reported for mirror of two SSDs, when UFS
fires zillion of BIO_DELETE requests, that totally blocks I/O subsystem by
pointless sorting of requests and responses under single mutex lock.
2015-04-10 00:43:24 +00:00
jhb
0fbe5b3df8 MFC 279951:
Simplify string mangling in ifmaybeload().
- Use strlcpy() instead of strcpy().
- Use strlcat() instead of a strlcpy() with a magic number subtracted
  from the length.
- Replace strncmp(..., strlen(foo) + 1) with strcmp(...).
2015-04-09 21:06:51 +00:00
jhb
a251dcdd5c MFC 279950:
Enable bzipfs support in the EFI loader.
- Add bzipfs to the list of supported filesystems in the EFI loader.
- Increase the heap size allocated for the EFI loader from 2MB to 3MB.
2015-04-09 19:51:55 +00:00
jhb
107a51b87f MFC 279949:
The System V ABI for amd64 allows functions to use space in a 128 byte
redzone below the stack pointer for scratch space and requires
interrupt and signal frames to avoid overwriting it. However, EFI uses
the Windows ABI which does not support this. As a result, interrupt
handlers in EFI push their interrupt frames directly on top of the
stack pointer. If the compiler used the red zone in a function in the
EFI loader, then a device interrupt that occurred while that function
was running could trash its local variables.  In practice this happens
fairly reliable when using gzipfs as an interrupt during decompression
can trash the local variables in the inflate_table() function
resulting in corrupted output or hangs.

Fix this by disabling the redzone for amd64 EFI binaries. This
requires building not only the loader but any libraries used by the
loader without redzone support.

Thanks to Jilles for pointing me at the redzone once I found the stack
corruption.
2015-04-09 19:36:06 +00:00
jhb
de91cfb164 MFC 279929:
Allow the EFI loader to work with large kernels and/or modules
(for example, a large mfsroot).  Note that for EFI the kernel and
modules (as well as other metadata files such as splash screens or
memory disk images) are loaded into a statically-sized staging area.
When the EFI loader exits it copies this staging area down to the
location the kernel expects to run at.
- Add bounds checking to the copy routines to fail attempts to access
  memory outside of the staging area.  Previously loading a combined
  kernel + modules larger than the staging size (32MB) would overflow
  the staging area trashing whatever memory was afterwards.  Under
  Intel's OVMF firmware for qemu this resulted in fatal faults in the
  firmware itself.  Now the attempt will fail with ENOMEM.
- Allow the staging area size to be configured at compile time via
  an EFI_STAGING_SIZE variable in src.conf or on the command line.
  It accepts the size of the staging area in MB.  The default size
  remains 32MB.
2015-04-09 19:03:11 +00:00
jhb
12300475aa MFC 279952:
- Align comment for df flags variable in periodic.conf.
- Note default value of df flags variable in periodoc.conf(5).
2015-04-09 18:50:41 +00:00
jhb
8bd7c86f6f MFC 279931:
Spin the twiddle in dosfs to give visual feedback for disk I/O on
FAT filesystems as is done for other filesystems in the loader.
2015-04-09 18:45:03 +00:00
jhb
d79cd9bb71 MFC 279892:
Resize receive socket buffers that support autosizing when receiving
TCP data via direct data placement.
2015-04-09 17:56:25 +00:00
mav
cffb1bfcba MFC r280702: Make swapper release orphaned (lost) GEOM provider.
Swap device is still reported as enabled, and system still may crash later
if some swapped-out kernel pages were lost with the device, but at least
GEOM and CAM can now release the lost disk, allowing it to be reconnected.
2015-04-09 10:11:47 +00:00
mav
5f22f76484 MFC r280687: Make GEOM_PART work in presence of previous withered self. 2015-04-09 10:10:05 +00:00
mav
2b74acfbcc MFC r280686: Report withered providers as such alike to GEOMs. 2015-04-09 10:08:11 +00:00
mav
baa4297d14 MFC r280685: When searching for provider by name, prefer non-withered one. 2015-04-09 10:05:58 +00:00