Commit Graph

74350 Commits

Author SHA1 Message Date
Ed Maste
12fbadae8a MFC r198525:
Whitespace fixup: 8 spaces -> tab
2009-11-05 18:34:01 +00:00
Matt Jacob
699050d8d5 Unbreak SBus cards which have been broken (apparently) for a while.
Most of the pieces came from Marius- correct settings for channels
and resource management. The one piece missing was that you cannot
for SBus cards replace 32 bit operations with A64 operations- not
supported. This is an MFC of r198822.
2009-11-05 18:25:26 +00:00
John Baldwin
dad4753c04 MFC 198554:
Fix some problems with effective mmap() offsets > 32 bits.  This was
partially fixed on amd64 earlier.  Rather than forcing linux_mmap_common()
to use a 32-bit offset, have it accept a 64-bit file offset.  This offset
is then passed to the real mmap() call.  Rather than inventing a structure
to hold the normal linux_mmap args that has a 64-bit offset, just pass
each of the arguments individually to linux_mmap_common() since that more
closes matches the existing style of various kern_foo() functions.
2009-11-04 20:49:14 +00:00
Pyun YongHyeon
0b333599d5 MFC r197586:
It seems some 82559ER controllers do not support Rx checksum
  offloading. Datasheet said nothing about the limitation of 82559ER
  except WOL. Explicitly disable Rx checksum offloading for
  controllers that is known to lack the capability.

  PR:	kern/138135
  Tested by:	Gooderum, Mark < mgooderum <> websense dot com >
2009-11-04 18:31:43 +00:00
John Baldwin
6fd3786837 MFC 197772:
When the timeout backoff hits the maximum value, leave it capped at the
maximum value rather than setting it to the result of a boolean expression
that is always true.
2009-11-04 16:58:26 +00:00
Christian Brueffer
a4f93c1075 MFC: r198539
Close a stream file descriptor leak.
2009-11-04 13:30:32 +00:00
Christian Brueffer
e4e76802b8 MFC: r198537
Close a file descriptor leak in an error case.
2009-11-04 13:06:09 +00:00
Christian Brueffer
efab19fed7 MFC: r198546
Remove spurious `)`
2009-11-04 12:35:35 +00:00
Andrew Thompson
b64689e0fb MFC r198775
Fix a corner case where usbd_transfer_drain() can return too early if the
 callback has dropped the mutex, leading to a panic.

Submitted by:	HPS
2009-11-04 01:50:25 +00:00
Rui Paulo
db463c13da MFC r198581:
Update the route's sequence number upon receiving a RANN.
2009-11-03 23:26:31 +00:00
Max Laier
67de44048a MFC r197334,r197433:
Extract svn and git version info from git-svn repos.
2009-11-03 21:57:00 +00:00
Ed Maste
55dd54d73f MFC r197011:
Increase AAC_CMD_TIMEOUT from 30s to 120s to help avoid spurious
  "COMMAND 0x........ TIMEOUT AFTER .. SECONDS" messages.  Any commands
  that get truly stuck will still trigger the warning and the hardware
  health check, just a little bit later.
2009-11-02 16:54:23 +00:00
Ed Maste
f94d7478f3 MFC r197082:
If the pxe client is told to use / as the root path, honour that rather
of trying to mount /pxeroot instead.

PR:		i386/106493
Submitted by:	Andrey Russev
2009-11-02 16:46:06 +00:00
Ed Maste
b561979f8c MFC r197692:
In fill_kinfo_thread, copy the thread's name into struct kinfo_proc even
  if it is empty.  Otherwise the previous thread's name would remain in the
  struct and then be reported for this thread.

Submitted by:	Ryan Stone
2009-11-02 16:32:32 +00:00
Ed Maste
af8e9d942c MFC r198541:
Do first controller time sync after 1 minute, as in Adaptec's vendor
  driver.
2009-11-02 16:22:59 +00:00
Robert Noland
de546efdad MFC 198696
Cleanup in r600_blit

     - Don't bother to assign vb until we know we have enough space
     - Add variables for sx2, sy2, dx2, dy2 so that these aren't
       calculated over and over, also reduce chance of errors.
     - Use switch to assign color/format
2009-11-02 16:02:16 +00:00
Robert Noland
1a4d349290 MFC 198695
A bit of cleanup work on radeon_freelist_get()

 * Fix the main loop to search all buffers before sleeping.
 * Remove dead code
2009-11-02 15:59:55 +00:00
Robert Noland
6400e3ac8c MFC 198692
Use system specified memory barriers rather than rolling our own.
2009-11-02 15:57:03 +00:00
Robert Noland
1675ae3b86 MFC 198691
Fix blitter support for RS880 chips
2009-11-02 15:53:32 +00:00
Max Khon
fd6bbf0435 MFC: Allow KMOD with hypens and dots. 2009-11-02 09:47:15 +00:00
Alan Cox
588b5e6ee8 MFC r197331, r197394
Add getpagesizes(3).
2009-11-01 19:22:07 +00:00
Andriy Gapon
ea9b1909f6 MFC 197450: number of cleanups in i386 and amd64 pci md code 2009-11-01 18:39:26 +00:00
Andriy Gapon
2df1facbb7 MFC 198279: fix sorting of some amd* entries in some makefiles 2009-11-01 17:56:45 +00:00
Andriy Gapon
fc06d8191e MFC 198271: add amdtemp to i386 NOTES 2009-11-01 17:53:33 +00:00
Andriy Gapon
f13868d206 MFC 197647: cpufunc.h: unify/correct style of c extension names 2009-11-01 17:45:37 +00:00
Andriy Gapon
33b3442f13 MFC 197658: print machine in kernel boot version string
PR:		kern/126926
2009-11-01 17:40:05 +00:00
Andriy Gapon
b8daad66fd MFC 197641: print_caddr_t: drop incorrect __unused from parameter 2009-11-01 17:36:36 +00:00
Andriy Gapon
0406cc12b6 MFC r197128,197325: add support for smbus controller found in AMD SB700 2009-11-01 11:34:13 +00:00
Ed Schouten
f36e7051c7 MFC various commits back to stable/8:
SVN r197174:
  Make sure we never place the cursor outside the screen.

  For some vague reason, it may be possible that scp->cursor_pos exceeds
  scp->ysize * scp->xsize. This means that teken_set_cursor() may get
  called with an invalid position. Just ignore the old cursor position in
  this case.

  Reported by:  Paul B. Mahol <onemda gmail com>

SVN r198213:
  Make lock devices work properly.

  It turned out I did add the code to use the init state devices to set
  the termios structure when opening the device, but it seems I totally
  forgot to add the bits required to force the actual locking of flags
  through the lock state devices.

  Reported by:	ru

SVN r198215, r198217:
  Fix a typo in the jail(8) manpage.

  Submitted by: Jille Timmermans <jille quis cx>

SVN r198216:
  Fix qouting in a comment, to make it look more consistent

  Submitted by: Jille Timmermans <jille quis cx>

SVN r198223:
  Properly set the low watermarks when reducing the baud rate.

  Now that buffers are deallocated lazily, we should not use
  tty*q_getsize() to obtain the buffer size to calculate the low
  watermarks. Doing this may cause the watermark to be placed outside the
  typical buffer size.

  This caused some regressions after my previous commit to the TTY code,
  which allows pseudo-devices to resize the buffers as well.

  Reported by:  yongari, dougb
2009-11-01 10:30:30 +00:00
Alexander Motin
5d933cfd98 MFC rev. 198623:
Add missing ATA kernel options dependencies.
2009-11-01 10:01:39 +00:00
Stacey Son
83613795b2 MFC 197240,197241,197242,197243,197293,197294,197407:
Add EVFILT_USER filter and EV_DISPATCH/EV_RECEIPT flags to kevent(2).

Approved by: rwatson (mentor)
2009-10-31 21:22:18 +00:00
Alan Cox
13529df13b MFC r197317
When superpages are enabled, add the 2 or 4MB page size to the array of
  supported page sizes.
2009-10-31 19:02:08 +00:00
Alan Cox
ebc91405bd MFC r197316
Add a new sysctl for reporting all of the supported page sizes.
2009-10-31 18:54:26 +00:00
Alan Cox
38c15033c7 MFC r198472
Eliminate an unnecessary check from vm_fault_prefault().
2009-10-31 18:18:32 +00:00
Antoine Brodin
5a1c285266 MFC r196891 to stable/8:
Change w_notrunning and w_stillcold from pointer to array so that sizeof
  returns what is expected.

  PR:		kern/138557
  Discussed with:	brucec@
  MFC after:	1 month
2009-10-31 12:26:40 +00:00
Christian Brueffer
ce68852cc2 MFC: r198356
Fix a memory leak in an error case.
2009-10-31 11:08:04 +00:00
Christian Brueffer
b7ef6e29a5 MFC: r198327
Add a missing free() call.
2009-10-31 10:59:53 +00:00
Rui Paulo
e22a16d5d3 MFC r198230, r198242, r198260, r198346, r198369, r198384:
More mesh fixes to comply with latest draft.
2009-10-30 19:59:50 +00:00
Robert Noland
5a3d86c297 MFC r197950
Add pci id's for Intel G41 chipset
2009-10-30 16:43:28 +00:00
Robert Noland
6137518b87 MFC r197951
Add support for Intel G41 chipset
2009-10-30 16:37:58 +00:00
Robert Noland
357a8e800b MFC r196470-196471,197154-197155,197603-197606
Sync radeon drm support

This adds kernel support for r6/7xx 3D.
2009-10-30 16:32:35 +00:00
Robert Noland
d84490b532 MFC r196466
Add a read only sysctl tracking the hw.drm.msi tunable.
2009-10-30 16:14:17 +00:00
Robert Noland
1587b7fc87 MFC r196465
Clean up the handling of device minors
2009-10-30 16:12:28 +00:00
Robert Noland
e7d8e24d0a MFC r196464
Clean up the locking in drm_alloc_resource()
2009-10-30 16:06:32 +00:00
Robert Noland
713444a957 MFC r198097
Set the active flag in the PMBR when we install bootcode on a GPT
partitioned disk.  Some BIOS require this to be set before they will
boot the device.
2009-10-30 15:45:00 +00:00
Andrew Thompson
bfa1f203df MFC r198373
Allow dumping the USB mouse reports via 'sysctl -b dev.ums.N.parseinfo',
 previously only available via bootverbose.

PR:		usb/137191
2009-10-29 23:28:48 +00:00
Andrew Thompson
fbcc87cbbc MFC r198258
Add opt_gdb.h which is now needed by ucom.
2009-10-29 23:28:21 +00:00
Andrew Thompson
906c96039d MFC r198257
Add support for newer WinChipHead CH341 chips, previously in the uch341 driver.
2009-10-29 23:27:40 +00:00
Andrew Thompson
83c0f67853 MFC r198153
Correct offset calcluation for the NCM implementation.
2009-10-29 23:27:00 +00:00
Andrew Thompson
6a8d0ac969 MFC r198152
Only poll ukbd if KDB is active.
2009-10-29 23:26:29 +00:00
Andrew Thompson
1ea6a20c73 MFC r198151
Workaround buggy BIOS code in USB regard. By doing the BIOS to OS handover for
 all host controllers at the same time, we avoid problems where the BIOS will
 actually write to the USB registers of all the USB host controllers every time
 we handover one of them, and consequently reset the OS programmed values.
2009-10-29 23:25:52 +00:00
Andrew Thompson
b0deb9099b MFC r197999 (hrs)
Fix the 106/109 USB Japanese keyboard "underscore" issue.
 Sun Type 6 USB keyboard support added in rev 1.46 conflicted with
 some scan codes used in Japanese keyboards because the scan code
 conversion routine was ambiguous for the overlapped codes.

PR:		ports/134005
2009-10-29 23:25:13 +00:00
Andrew Thompson
48bd741396 MFC r197573
Add back endpoint swap detection that was disabled in an earlier driver
 conversion.
2009-10-29 23:24:41 +00:00
Andrew Thompson
b56d97e2af MFC r197572
Add new FTDI IDs.
2009-10-29 23:24:10 +00:00
Andrew Thompson
e792954dba MFC r197570
Add experimental support for usb serial console and polled mode during DDB.
2009-10-29 23:23:34 +00:00
Andrew Thompson
6b48cd2444 MFC r197569
Add a config number quirk for the ELSA_MODEM1
2009-10-29 23:22:54 +00:00
Andrew Thompson
589c414bdf MFC r197568
add more device IDs
2009-10-29 23:22:23 +00:00
Andrew Thompson
9d2344fb86 MFC r197567
Allow setting of MAC address for AXE based ethernet adapters.
2009-10-29 23:21:52 +00:00
Andrew Thompson
381882bf15 MFC r197566
Increase the rx buffer size to 16384 bytes, this increases RX performance from
 50Mbps to 220Mbps on PLANEX GU-1000T.
2009-10-29 23:21:20 +00:00
Andrew Thompson
c21bee0c36 MFC r197565
- Remove SAMSUNG_YP_U2 now that it is in the cam layer
 - Add quirk from Tobias Grosser for Western Mypassword
2009-10-29 23:20:47 +00:00
Andrew Thompson
078da83100 MFC r197564
Add new usbdev entries for Marvell, FTDI, Option and Western.
2009-10-29 23:20:15 +00:00
Andrew Thompson
d66897e03e MFC r197563
Add basic support for USB Network Control Model (NCM) v1.0 to if_cdce.c.
2009-10-29 23:19:41 +00:00
Andrew Thompson
57866e6c93 MFC r197562
Add extra safety locking when clobbering xfer->flags_int.started in start and
 stop functions, because xfer->flags_int is also updated by the USB controller,
 under the controller lock.
2009-10-29 23:18:59 +00:00
Andrew Thompson
d81c7ac0fa MFC r197561
Correct buffer sizes used so that they match. The old code could give the
 impression that a overflow situation existed but was not possible.
2009-10-29 23:18:27 +00:00
Andrew Thompson
88f788a6c5 MFC r197559
Add support for USB language selection.

PR:		usb/138563
2009-10-29 23:17:54 +00:00
Andrew Thompson
9d168176f5 MFC r197558
Fix NULL-pointer dereference in usb_endpoint_foreach().

PR:		usb/138389
2009-10-29 23:17:23 +00:00
Andrew Thompson
f23c09d0b0 MFC r197556
Clear all interrupts rather than just SETUP packet.
2009-10-29 23:16:39 +00:00
Andrew Thompson
320dbc0942 MFC r197555
Simplify logic around setting EHCI_QH_DTC and expand some htohc32(temp.sc, 0)
 statements to zero.
2009-10-29 23:16:00 +00:00
Andrew Thompson
ffa540b752 MFC r197554
Import two PCI quirks from Linux

  - Add quirk for ATI SB600 and SB700 to free SMB controller
  - Correct schedule sleep time to 10us on the VIA ehci controller
2009-10-29 23:15:26 +00:00
Andrew Thompson
1063b450cd MFC r197553
- clean up USB detach logic. There seems to be some problems detaching multiple
   USB HUBs connected in series from the root.
2009-10-29 23:14:39 +00:00
Andrew Thompson
6333b36c43 MFC r196826
Make umass(4) pass device USB serial number to CAM, making it possible
 to e.g. retrieve it using camcontrol(8).
2009-10-29 23:14:06 +00:00
Andrew Thompson
6536a23656 MFC r196497
Remove redundant locking.
2009-10-29 23:13:36 +00:00
Andrew Thompson
f18778a473 MFC r196496
Add a reminder comment to optimize bus_dmamap_sync calls.
2009-10-29 23:13:02 +00:00
Andrew Thompson
edd4ee99cf MFC r196495
Add mass storage quirks.

PR:             usb/137138,usb/137226,usb/137789,usb/135372
2009-10-29 23:12:29 +00:00
Andrew Thompson
d92f7ea655 MFC r196494
- fix uvisor support, mostly correct buffer sizes used.
 - correct device info flag for SONY Cli NR70V
2009-10-29 23:11:48 +00:00
Andrew Thompson
d51a8c13ea MFC r196493
- Fix false positive uipaq probe
2009-10-29 23:11:13 +00:00
Andrew Thompson
2bb2691018 MFC r196492
- fix CDC ethernet matching order so that the match flags get correct.
2009-10-29 23:10:41 +00:00
Andrew Thompson
0627fc1870 MFC r196491
We used force all of the GPIO pins low first and then
 enable the ones we want. This has been changed to better
 match the ADMtek's reference design to avoid setting the
 power-down configuration line of the PHY at the same time
 it is reset.
2009-10-29 23:10:11 +00:00
Andrew Thompson
9fd6caea70 MFC r196490
- FIFO's are always opened separately in read and write direction even if the
   actual device is opened for read and write. Fix fflags check so that the UFM
   and URIO drivers work.
2009-10-29 23:09:37 +00:00
Andrew Thompson
61908699b5 MFC r196488
- allow disabling "root_mount_hold()" by setting a sysctl/tunable at boot
 - remove some redundant initial explore code
2009-10-29 23:09:02 +00:00
Konstantin Belousov
5984920662 MFC r197930:
Postpone dropping fp till both kq_global and kqueue mutexes are
unlocked.
2009-10-29 16:28:21 +00:00
Konstantin Belousov
c2204c03c8 MFC r197389:
Do panic regardeless of execution mode at the moment of T_RESERVED trap.
2009-10-29 16:24:39 +00:00
Konstantin Belousov
ce8e32de5c MFC r197428:
Add per-process osrel node to the procfs, to allow read and set p_osrel
value for the process.
2009-10-29 16:19:58 +00:00
John Baldwin
ff5bfa3ef6 MFC 197439:
Extract the code to find and map the MADT ACPI table during early kernel
startup and genericize it so it can be reused to map other tables as well:
- Add a routine to walk a list of ACPI subtables such as those used in the
  APIC and SRAT tables in the MI acpi(4) driver.
- Move the routines for mapping and unmapping an ACPI table as well as
  mapping the RSDT or XSDT and searching for a table with a given signature
  out into acpica_machdep.c for both amd64 and i386.
2009-10-29 16:00:27 +00:00
John Baldwin
983998573b MFC 197649:
Do not hold the ACPI A/C adapter lock when changing the power profile.
2009-10-29 15:28:05 +00:00
John Baldwin
9ad4b9fbd2 MFC 197648:
Split the 'video' ACPI lock up into two locks to resolve a LOR with the
sysctl lock.  The 'video' lock now protects the 'bus' of video output
devices attached to a graphics adapter.  It is used when iterating over
the list of outputs, etc.  The 'video_output' lock is used to lock the
output-specific data similar to a driver lock for the individual video
outputs.
2009-10-29 15:24:57 +00:00
John Baldwin
9e14139d9b MFC 196840:
Fill the reverse RSS map with 0xff's so that the subsequent loop to
calculate the values will work properly.
2009-10-29 15:17:59 +00:00
John Baldwin
50d356311a MFC 197460:
Remove unnecessary locking from attach().  This fixes a LOR between the
acpi_ibm lock and the sysctl lock.
2009-10-29 15:13:36 +00:00
John Baldwin
a6fb726860 MFC 196615:
Extend the device pager to support different memory attributes on different
pages in an object.
- Add a new variant of d_mmap() currently called d_mmap2() which accepts
  an additional in/out parameter that is the memory attribute to use for
  the requested page.
- A driver either uses d_mmap() or d_mmap2() for all requests but not both.
  The current implementation uses a flag in the cdevsw (D_MMAP2) to indicate
  that the driver provides a d_mmap2() handler instead of d_mmap().  This
  is done to make the change ABI compatible with existing drivers and
  MFC'able to 7 and 8.
2009-10-29 15:09:54 +00:00
Alexander Motin
f39d3da87e MFC rev. 198487:
Round timeout up when converting CAM milliseconds to ATA seconds.
2009-10-29 10:38:17 +00:00
Alexander Motin
963069c15e MFC rev. 198488:
Report SATA speeds to CAM, to not confuse users with low numbers logged.
2009-10-29 10:35:50 +00:00
Alexander Motin
e180821780 MFC rev. 198481, 198482:
Add two more VIA SATA chip IDs.

PR:		kern/135057
2009-10-29 10:05:08 +00:00
Alexander Motin
6b7a5f803b MFC rev. 198480, 198483:
Document new modularised ATA kernel modules and options.

PR:             kern/133162, amd64/139859
2009-10-29 09:58:16 +00:00
Alexander Motin
9149cb69ab Fix SATA on nVidia MCP55 chipset. It needs some short time to allow BAR(5)
memory access.

PR:		amd64/128686, amd64/132372, amd64/139156
2009-10-29 09:45:48 +00:00
Qing Li
f60909e3e2 MFC r198418
Use the correct option name in the preprocessor command to enable
or disable diagnostic messages.

Reviewed by:	ru
2009-10-28 21:45:25 +00:00
Qing Li
54b7653bd5 MFC r198353
Verify "smp_started" is true before calling
sched_bind() and sched_unbind().

Reviewed by:	kmacy
2009-10-28 21:43:16 +00:00
Ken Smith
1e5dd50780 Prepare for 8.0-RC2 builds.
Approved by:	re (implicit)
2009-10-25 00:28:01 +00:00
Ruslan Ermilov
f47552e770 MFC r198295:
Random number generator initialization cleanup:

- Introduce new SI_SUB_RANDOM point in boot sequence to make it
clear from where one may start using random(9).  It should be as
early as possible, so place it just after SI_SUB_CPU where we
have some randomness on most platforms via get_cyclecount().

- Move stack protector initialization to be after SI_SUB_RANDOM
as before this point we have no randomness at all.  This fixes
stack protector to actually protect stack with some random guard
value instead of a well-known one.

Note that this patch doesn't try to address arc4random(9) issues.
With current code, it will be implicitly seeded by stack protector
and hence will get the same entropy as random(9).  It will be
securely reseeded once /dev/random is feeded by some entropy from
userland.

Submitted by:	Maxim Dounin <mdounin@mdounin.ru>
Approved by:	re (kib)
2009-10-24 04:55:14 +00:00
John Baldwin
115753ce9e MFC 198174:
Close a race with caching of -ve name lookups in the NFS client.
Specifically, clients only trust -ve cache entries while the directory
remains unchanged and discard any -ve cache entries for a directory when
they notice that the modification time of a directory entry changes.  The
race involves two concurrent lookups as follows:
- Thread A does a lookup for file 'foo' which sends a lookup RPC to the
  server.  The lookup fails and the server replies.
- The 'foo' file is created (either by the same client or a different
  client) updating the modification time on the parent directory of 'foo'.
- Thread B does a lookup for a different file 'bar' which updates the
  cached attributes of the parent directory of 'foo' to reflect the new
  modification time after 'foo' was created.
- Thread A finally resumes execution to parse the reply from the NFS
  server.  It adds a -ve cache entry and sets the cached value of the
  directory's modification time that is used for invalidating -ve cached
  lookups to the new modification time set by thread B.

At this point, future lookups of 'foo' will honor the -ve cached entry
until the cached entry is pushed out of the name cache's LRU or the
modification time of the parent directory is changed again by some other
change.  The fix is to read the directory's modification time before
sending the lookup RPC and use that cached modification time when setting
the directory's cached modification time.  Also, we do not add a -ve cache
entry if another thread has added -ve cache entry that set the directory's
cached modification time to a newer value than the value we read before
sending the lookup RPC.

Approved by:	re (kib)
2009-10-23 19:52:29 +00:00
Qing Li
dbd4bfe317 MFC 198306
The flow-table function flowtable_route_flush() may be called
during system initialization time. Since the flow-table is
designed to maintain per CPU flow cache, the existing code
did not check whether "smp_started" is true before calling
sched_bind() and sched_unbind(), which triggers a page fault.

Reviewed by:	jeff
Approved by:	re
2009-10-22 18:48:25 +00:00
Edward Tomasz Napierala
1c7deea437 MFC r196863:
Improve wording.

MFC r196941:

Prevent the line from wrapping.

Approved by:	re (kib)
2009-10-22 16:26:38 +00:00
Andrew Thompson
b1c3c31d58 MFC r198307
Change from CAM_TID_INVALID to CAM_SEL_TIMEOUT error code when the usb device
 has been yanked, this works around a cam recounting bug when
 CAM_DEV_UNCONFIGURED is set late in the detach. In certain conditions the
 reference to the XPT device would not be released which would cause the usb
 explore thread to sleep forever on "simfree", preventing any new usb devices to
 be found/ejected on the bus.

Approved by:	re (kib)
2009-10-21 19:48:27 +00:00
Konstantin Belousov
46aaa1ed67 MFC r198201:
Remove spurious call to priv_check(PRIV_VM_SWAP_NOQUOTA).
Call priv_check(PRIV_VM_SWAP_NORLIMIT) only when per-uid limit is
actually exceed.

Approved by:	re (kensmith)
2009-10-21 15:07:34 +00:00
Robert Watson
cbdd92bda4 Merge r198233 from head to stable/8:
Clean up comments, white space, and style in pfil.c (VNET changes not
  MFC'd)

Approved by:	re (kib)
2009-10-21 14:05:51 +00:00
Robert Watson
5e2ef9933c Merge r198198 from head to stable/8:
Line-wrap pfil.c so that it prints more nicely.

Approved by:	re (kensmith)
2009-10-21 13:11:38 +00:00
Robert Watson
304762b138 Merge r198219 from head to stable/8:
Remove unused pfil_flags field in packet_filter_hook.

Approved by:	re (kib)
2009-10-21 09:53:55 +00:00
Qing Li
0eb4d28bac MFC 198301
In the ARP callout timer expiration function, the current time_second
is compared against the entry expiration time value (that was set based
on time_second) to check if the current time is larger than the set
expiration time. Due to the +/- timer granularity value, the comparison
returns false, causing the alternative code to be executed. The
alternative code path freed the memory without removing that entry
from the table list, causing a use-after-free bug.

Reviewed by:	discussed with kmacy
Approved by:	re
Verified by:	rnoland, yongari
2009-10-20 21:36:56 +00:00
Robert Watson
752b1b6971 Merge r198218 from head to stable/8:
Sort function prototypes in pfil.h, clean up white space, and better
  align fields for printing.

Approved by:	re (kensmith)
2009-10-20 18:54:51 +00:00
Weongyo Jeong
6fb7173c2b MFC r198098:
fixes a TX hang bug that it could happen when if_start callback didn't
  be restarted by full of the output queue.

  Tested by:      bsduser <bsd at acd.homelinux.org>

MFC r198099:
  fixes a TX hang that could be possible to happen when the trasfers are
  in the high speed that some drivers don't call if_start callback after
  marking ~IFF_DRV_OACTIVE.

Approved by:	re (kib)
2009-10-20 17:50:36 +00:00
Qing Li
6f99a646e4 MFC r198111
This patch fixes the following issues in the ARP operation:

1. There is a regression issue in the ARP code. The incomplete
   ARP entry was timing out too quickly (1 second timeout), as
   such, a new entry is created each time arpresolve() is called.
   Therefore the maximum attempts made is always 1. Consequently
   the error code returned to the application is always 0.
2. Set the expiration of each incomplete entry to a 20-second
   lifetime.
3. Return "incomplete" entries to the application.
4. The return error code was incorrect.

Reviewed by:	kmacy
Approved by:	re
2009-10-20 17:44:50 +00:00
Stanislav Sedov
ea95296ce8 - Disable ASF by default in STABLE_8. This causes a lot
of problems on non-DELL branded machines with IPMI
  support.  The proposed fix was committed to HEAD but has
  not received much test coverage yet.

Discussed with:	bz
Approved by:	re (kensmith)
2009-10-20 16:41:23 +00:00
Robert Watson
92b52ada7c Merge r198196 from head to stable/8:
Rewrap ip_input() comment so that it prints more nicely.

Approved by:	re (kib)
2009-10-20 16:22:31 +00:00
Konstantin Belousov
dc68cec603 MFC r197934:
Map PIE binaries at non-zero base address.

MFC r198202:
Honour non-zero mapbase for PIE binaries. Inform interpreter-less PIE
binary about its relocbase.

Approved by:	re (kensmith)
2009-10-20 13:34:41 +00:00
Konstantin Belousov
55f128de91 MFC r197933:
Define architectural load bases for PIE binaries.

MFC r198203 (by marius):
Change load base for sparc to match default gcc memory layout model.

Approved by:	re (kensmith)
2009-10-20 13:32:28 +00:00
Konstantin Belousov
5b15472fe9 MFC r197932:
Do not map elf segments of zero length.

Approved by:	re (kensmith)
2009-10-20 13:30:06 +00:00
John Baldwin
74fb2c91c6 MFC 198126:
Fix a sign bug in the handling of nice priorities when computing the
interactive score for a thread.

Approved by:	re (kib)
2009-10-19 19:40:05 +00:00
John Baldwin
a9266569b7 MFC 198079:
Use zfs_read() instead of xfsread() to read /boot.config.  xfsread() fails
short read requests, so the result was that a /boot.config smaller than 512
bytes was ignored.  boot2 uses fsread() instead of xfsread() to read
/boot.config already, so this makes zfsboot more like boot2.

Approved by:	re (kib)
2009-10-19 18:31:39 +00:00
Rui Paulo
596646aee5 MFC 197975, 197977, 197980, 198027:
Update for latest 802.11s changes in meshconf format.

Approved by:	re (kib)
2009-10-17 13:42:23 +00:00
Robert Watson
0dcda942fd Add a MODULE_DEPEND() on the NFS client from dtnfsclient so that dtnfsclient
can access NFS client symbols.

Discussed with:	kib
Reported by:	markm
Approved by:	re (kib)
2009-10-15 14:39:59 +00:00
Michael Tuexen
bef10df88e MFC r197868.
Use correct arguments when calling SCTP_RTALLOC().
Approved by: re, rrs (mentor)
2009-10-14 17:26:05 +00:00
Ermal Luçi
d8e86c4a5d Fix typo which has survived amazingly long!
Reviewed by:	mlaier(mentor)
Approved by:	re(kib)
2009-10-14 15:32:46 +00:00
Attilio Rao
be0ac16015 MFC r197476:
In function do_rw_wrlock, when a writer got an error and before returning,
check if there are readers blocked by us via URWLOCK_WRITE_WAITERS flag,
and resume the readers. The error must be EAGAIN, otherwise there must
have memory problem, and nobody can rescue the buggy application.

Approved by:	re (kib), davidxu
2009-10-13 13:03:31 +00:00
Konstantin Belousov
aba70b5e59 MFC r197942:
Refine r195509, instead of checking that vnode type is VBAD, that is
set quite late in the revocation path, properly verify that vnode is
not doomed before calling VOP.

Approved by:	re (bz)
2009-10-13 09:24:51 +00:00
Pawel Jakub Dawidek
69882ff11d MFC r197898:
If provider is open for writing when we taste it, skip it for classes that
depend on on-disk metadata. This was we won't attach to providers that are used
by other classes. For example we don't want to configure partitions on da0 if
it is part of gmirror, what we really want is partitions on mirror/foo.

During regular work it works like this: if provider is open for writing a class
receives the spoiled event from GEOM and detaches, once provider is closed the
taste event is send again and class can rediscover its metadata if it is still
there.  This doesn't work that way when new class arrives, because GEOM gives
all existing providers for it to taste, also those open for writing. Classes
have to decided on their own if they want to deal with such providers (eg.
geom_dev) or not (classes modified by this commit).

Reported by:	des, Oliver Lehmann <lehmann@ans-netz.de>
Tested by:	des, Oliver Lehmann <lehmann@ans-netz.de>
Discussed with:	phk, marcel
Reviewed by:	marcel
Approved by:	re (kib)
2009-10-12 21:08:06 +00:00
Pawel Jakub Dawidek
1d93d2aa4f MFC r197896:
Export disk serial numbers for adaX disks.

Reviewed by:	mav
Approved by:	re (kib)
2009-10-12 21:03:07 +00:00
Pawel Jakub Dawidek
d1c95b4a34 MFC r197831,r197842,r197843,r197860,r197861:
r197831:

Fix situation where Mac OS X NFS client creates a file and when it tries
to set ownership and mode in the same setattr operation, the mode was
overwritten by secpolicy_vnode_setattr().

PR:	kern/118320
Submitted by:	Mark Thompson <info-gentoo@mark.thompson.bz>

r197842:

Fix white-spaces.

r197843:

On FreeBSD it is enough to report provider removal when orphan event is
received, we don't have to do it on every ENXIO error in I/O path.
Solaris has no GEOM so they have to handle it in a less clean way.

r197860:

File system owner is when uid matches and jail matches.

r197861:

Allow file system owner to modify system flags if securelevel permits.

Approved by:	re (kib)
2009-10-12 20:36:55 +00:00
Attilio Rao
4dc32a7398 MFC r197803, r197824, r197910:
Per their definition, atomic instructions used in conjuction with
memory barriers should also ensure that the compiler doesn't reorder paths
where they are used.  GCC, however, does that aggressively, even in
presence of volatile operands.  The most reliable way GCC offers for avoid
instructions reordering is clobbering "memory".
Not all our memory barriers, right now, clobber memory for GCC-like
compilers.
Fix these cases.

Approved by:	re (kib)
2009-10-12 16:05:31 +00:00
Attilio Rao
3f4609ac69 MFC r197643, r197735:
When releasing a read/shared lock we need to use a write memory barrier
in order to avoid, on architectures which doesn't have strong ordered
writes, CPU instructions reordering.

Approved by:	re (kib)
2009-10-12 15:32:00 +00:00
Marcel Moolenaar
879632020a MFC change 197721:
Fix RTS/CTS flow control, broken by the TTY overhaul.  The new TTY
interface is fairly simple WRT dealing with flow control, but
needed 2 new RX buffer functions with "get-char-from-buf" separated
from "advance-buf-pointer" so that the pointer could be advanced
only when ttydisc_rint() succeeded.

Approved by:	re (kib)
2009-10-10 18:24:54 +00:00
Robert Watson
3e5cbaa4c7 Merge r197814 from head to stable/8:
Remove tcp_input lock statistics; these are intended for debugging only
  and are not intended to ship in 8.0 as they dirty additional cache
  lines in a performance-critical per-packet path.

Approved by:	re (kib, bz)
2009-10-09 09:18:22 +00:00
Bjoern A. Zeeb
67f0b21fa6 MFC r197727:
Put #ifdef INET around parts of the FLOWTABLE code, to unbreak
  nooptions INET kernel builds.

Approved by:	re (kib)
2009-10-08 20:58:09 +00:00
Konstantin Belousov
88c45ef724 MFC r197662:
Do not dereference vp->v_mount without holding vnode lock and checking
that the vnode is not reclaimed.

Approved by:	re (bz)
2009-10-08 11:28:32 +00:00
Robert Watson
f41dd6dca9 Merge r197795 from head to stable/8:
In tcp_input(), we acquire a global write lock at first only if a
  segment is likely to trigger a TCP state change (i.e., FIN/RST/SYN).
  If we later have to upgrade the lock, we acquire an inpcb reference
  and drop both global/inpcb locks before reacquiring in-order.  In
  that gap, the connection may transition into TIMEWAIT, so we need
  to loop back and reevaluate the inpcb after relocking.

  Reported by:        Kamigishi Rei <spambox at haruhiism.net>
  Reviewed by:        bz

Approved by:	re (kib)
2009-10-08 11:07:15 +00:00
Yoshihiro Takahashi
8fe1fb2047 MFC: revision 197730
unifdef NFSCLIENT because the nlm depends on the nfsclient even if NFSCLIENT
  is not defined.

  Now the nfslockd module works with the nfsclient module.

  Reviewed by:	kib

Approved by:	re (kensmith)
2009-10-07 14:14:05 +00:00
Qing Li
c8c92b5491 MFC r197696
Remove a log message from production code. This log message can be
triggered by a misconfigured host that is sending out gratuious ARPs.
This log message can also be triggered during a network renumbering
event when multiple prefixes co-exist on a single network segment.

Approved by:	re
2009-10-06 20:33:02 +00:00
Qing Li
7ec99f713d MFC 197695
Previously, if an address alias is configured on an interface, and
this address alias has a prefix matching that of another address
configured on the same interface, then the ARP entry for the alias
is not deleted from the ARP table when that address alias is removed.
This patch fixes the aforementioned issue.

PR:		kern/139113
Reviewed by:	bz
Approved by:	re
2009-10-06 19:44:44 +00:00
Qing Li
e85f0cc52d MFC r197687
The flow-table associates TCP/UDP flows and IP destinations with
specific routes. When the routing table changes, for example,
when a new route with a more specific prefix is inserted into the
routing table, the flow-table is not updated to reflect that change.
As such existing connections cannot take advantage of the new path.
In some cases the path is broken. This patch will update the affected
flow-table entries when a more specific route is added. The route
entry is properly marked when a route is deleted from the table.
In this case, when the flow-table performs a search, the stale
entry is updated automatically. Therefore this patch is not
necessary for route deletion.

Reviewed by:	bz, kmacy
Approved by:	re
2009-10-06 18:47:02 +00:00
Coleman Kane
4718640084 MFC: r197403, r197644, r197654, and r197659
Fix some unexpected potential NULL de-references in kernel mode due to
usage of pre-8.0 wifi operations with the ndis driver wrapping a Win32/64
wifi driver.

Submitted by:	Paul B Mahol <onemda@gmail.com>
Approved by:	re
2009-10-06 16:05:06 +00:00
Pyun YongHyeon
0baf4d9450 MFC r197461:
Use __NO_STRICT_ALIGNMENT to determine whether de(4) have to apply
  alignment fixup code for received frames on strict alignment
  architectures.

MFC r197463:
  Consistently use bus_addr_t.

MFC r197464:
  Destroy dmamap in dma cleanup.

MFC r197465:
  Align Tx/Rx descriptors on 32 bytes boundary instead of PAGE_SIZE.
  Also align setup descriptor on 32 bytes boundary. Tx buffer have no
  alignment limitation so create dmamap without alignment
  restriction[1]. Rx buffer still seems to require 4 bytes alignment
  limitation but we can simply use MCLBYTES for size to map the
  buffer instead of TULIP_DATA_PER_DESC as the buffer is allocated
  with m_getcl(9).
  de(4) supports up to TULIP_MAX_TXSEG segments for Tx buffers,
  increase maximum dma segment size to TULIP_MAX_TXSEG * MCLBYTES.
  While I'm here remove TULIP_DATA_PER_DESC as it is not used anymore.

  This should fix de(4) breakage introduced after r176206.
  Submitted by:	jhb [1]
  Reported by:	WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp >
  Tested by:	WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp >,
		Takahashi Yoshihiro < nyan <> jp dot freebsd dot org >
Approved by:	re (kib)
2009-10-05 19:29:25 +00:00
Andrew Gallatin
c005a51c4e MFC:197645
Two more mxge watchdog fixes

1) Restore the PCI Express control register after a watchdog
   reset.  This is required because the device will come out
   of watchdog reset with the pectl reg at its default state,
   and important BIOS configuration (like max payload size)
   could be lost.

2) Call mxge_start_locked() for every tx queue before dropping
   the lock in the watchdog handler.   This is required, as
   the queue's buf ring may have filled during the reset.

Approved by:	re (kib)
2009-10-05 14:28:23 +00:00
Yoshihiro Takahashi
ec89a806b8 MFC: revision 197709
Fix build nfscl and/or nfsd.

Approved by:	re (kib)
2009-10-05 14:03:26 +00:00
Andrew Thompson
3a3dfbf8c4 MFC r197682
EHCI Hardware BUG workaround

 The EHCI HW can use the qtd_next field instead of qtd_altnext when a short
 packet is received. This contradicts what is stated in the EHCI datasheet.
 Also the total-bytes field in the status field of the following TD gets
 corrupted upon reception of a short packet!  We work this around in software by
 not queueing more than one job/TD at a time of up to 16Kbytes! The bug has been
 seen on multiple INTEL based EHCI chips.  Other vendors have not been tested
 yet.

 - Applications using /dev/usb/X.Y.Z, where Z is non-zero are affected, but not
   applications using LibUSB v0.1, v1.2 and v2.0.
 - Mass Storage (umass) is affected.

Approved by:	re (kib)
2009-10-04 19:03:32 +00:00
Konstantin Belousov
9072a0309e MFC r197663:
As a workaround, for Intel CPUs, do not use CLFLUSH in
pmap_invalidate_cache_range() when self-snoop is apparently not reported
in cpu features.

Approved by:	re (bz, kensmith)
2009-10-04 12:20:59 +00:00
Konstantin Belousov
6832666db4 MFC r197661:
Move the annotation for vm_map_startup() immediately before the function.

Approved by:	re (bz, kensmith)
2009-10-04 12:14:49 +00:00
Konstantin Belousov
68ee1aac0a MFC r197660:
Fix typo.

Approved by:	re (bz, kensmith)
2009-10-04 12:11:44 +00:00
Xin LI
9516a85cc3 MFC revision 197683:
Return EOPNOTSUPP instead of EINVAL when doing chflags(2) over an old
format ZFS, as defined in the manual page.

Submitted by:	pjd (response of my original patch but bugs are mine)
Approved by:	re (kib)
2009-10-04 09:07:29 +00:00
Yoshihiro Takahashi
485080c4c4 MFC: revision 197657
MFi386: revision 197653

    Improve 802.11s comment.

Approved by:	re (bz)
2009-10-03 14:38:22 +00:00
Marius Strobl
721f5d589f MFC: r197490
Merge r194204 from amd64/i386:

Enable PRINTF_BUFR_SIZE by default.

PR:		139134
Approved by:	re (kib)
2009-10-02 18:33:40 +00:00
Simon L. B. Nielsen
bc7f0010f1 MFC r197711:
Add no zero mapping feature.

NOTE: Unlike in the other branches where this change will be "merged"
to, the 'no zero mapping' is enabled by default in stable/8.

Errata:		FreeBSD-EN-09:05.null
Approved by:	re (kib)
2009-10-02 17:58:47 +00:00
Alan Cox
1040e2e4d1 MFC r197580
Temporarily disable the use of 1GB page mappings by the direct map.

Approved by:	re (kib)
2009-10-02 05:11:46 +00:00
Yoshihiro Takahashi
4d1ed2a5c6 MFC: revision 197535
Add '#define NFSCLIENT' into opt_nfs.h if the NFSCLIENT variable is 1
  (the default is 1).

  This makes the nfslockd module works for NFS client.

  Reviewed by:	dfr

Approved by:	re (kib)
2009-10-01 14:42:55 +00:00
Jamie Gritton
a301d3226a MFC r197581, r197583, r197584:
Set the prison in NFS anon and GSS SVC creds.

Reviewed by:	marcel
Approved by:	re (kib)
2009-10-01 13:11:45 +00:00
Rui Paulo
f24f7ffbd4 MFC r197653:
Improve 802.11s comment.

Approved by:	re (kib)
2009-10-01 10:06:09 +00:00
Rui Paulo
f785216c4f Update 802.11s mesh support to draft 3.03. This includes a revised frame
format for peering and changes to the PERR frames.
Note that this is incompatible with the previous code.

Reviewed by:	sam
Approved by:	re (kib)
2009-09-29 12:18:23 +00:00
Pawel Jakub Dawidek
01985d6884 MFC r197287, r197289, r197351, r197426, r197458, r197459, r197497, r197498,
r197512, r197513, r197514, r197515, r197525:

r197287:

Purge namecache for the file system being rolled back, so it doesn't point at
invalid vnodes after the rollback resulting in EIO errors when trying to access
files which are in the namecache.

Reported by:	des

r197289:

Purge file system namecache when receiving incremental stream and rolling back
to it.

r197351:

Purge namecache in the same place OpenSolaris does.

r197426:

Restore BSD behaviour - when creating new directory entry use parent directory
gid to set group ownership and not process gid.

This was overlooked during v6 -> v13 switch.

PR:	kern/139076
Reported by:	Sean Winn <sean@gothic.net.au>

r197458:

Close race in zfs_zget(). We have to increase usecount first and then
check for VI_DOOMED flag. Before this change vnode could be reclaimed
between checking for the flag and increasing usecount.

r197459:

Before calling vflush(FORCECLOSE) mark file system as unmounted so the
following vnops will fail. This is very important, because without this change
vnode could be reclaimed at any point, even if we increased usecount. The only
way to ensure that vnode won't be reclaimed was to lock it, which would be very
hard to do in ZFS without changing a lot of code. With this change simply
increasing usecount is enough to be sure vnode won't be reclaimed from under
us. To be precise it can still be reclaimed but we won't be able to see it,
because every try to enter ZFS through VFS will result in EIO.

The only function that cannot return EIO, because it is needed for vflush() is
zfs_root(). Introduce ZFS_ENTER_NOERROR() macro that only locks
z_teardown_lock and never returns EIO.

r197497:

Switch to fletcher4 as the default checksum algorithm. Fletcher2 was proven to
be a bit weak and OpenSolaris also switched to fletcher4.

r197498:	head/cddl/contrib/opensolaris

Fletcher4 is not the default checksum algorithm.

r197512:

- Don't depend on value returned by gfs_*_inactive(), it doesn't work
  well with forced unmounts when GFS vnodes are referenced.
- Make other preparations to GFS for forced unmounts.

PR:	kern/139062
Reported by:	trasz

r197513:

Use traverse() function to find and return mount point's vnode instead of
covered vnode when snapshot is already mounted.

r197514:

On lookup error VFS expects *vpp to be set to NULL, be sure to do that.

r197515:

Handle cases where virtual (GFS) vnodes are referenced when doing forced
unmount. In that case we cannot depend on the proper order of invalidating
vnodes, so we have to free resources when we have a chance.

PR:	kern/139062
Reported by:	trasz

r197525:

Ensure that tv_sec is between INT32_MIN and INT32_MAX, so ZFS won't object.
This completes the fix from r185586.

PR:	kern/139059
Reported by:	Daniel Braniss <danny@cs.huji.ac.il>
Submitted by:	Jaakko Heinonen <jh@saunalahti.fi>
Tested by:	Daniel Braniss <danny@cs.huji.ac.il>

Approved by:	re (kib)
2009-09-29 10:53:06 +00:00
Andrew Gallatin
264d14d30d MFC 197395: Improve mxge watchdog routine's ability to reliably reset a failed NIC
Approved by: re (kib)
2009-09-28 23:48:16 +00:00
Michael Tuexen
fe36e02918 MFC r197341.
Fix errnos.

Approved by: re (bz), rrs (mentor)
2009-09-28 18:32:28 +00:00
Konstantin Belousov
b57f5ce0bd MFC r197390:
Remove forward_roundrobin().

Approved by:	re (kensmith)
2009-09-28 11:31:21 +00:00
Marius Strobl
238bc19306 MFC: r197401
- According to Linux, the ALi M5451 can do 31-bit DMA instead of just
  30-bit like the reset of the controllers supported by this driver.
  Actually ALi M5451 can be setup up to generate 32-bit addresses by
  setting the 31st bit via the accompanying ISA bridge, which allows
  it to work in sparc64 machines whose IOMMU require at least 32-bit
  DMA. Even though other architectures would also benefit from 32-bit
  DMA, enabling this bit is limited to sparc64 as bus_dma(9) doesn't
  generally guarantee that a low address of BUS_SPACE_MAXADDR_32BIT
  results in a buffer in the 32-bit range.
- According to Tatsuo YOKOGAWA's ali(4), the the DMA transfer size of
  ALi M5451 is fixed to 64k and in fact using the default size of 4k
  causes the chip to overrun the mapping, triggering uncorrectable
  DMA errors on sparc64.
- The 4DWAVE DX and NX require the recording buffer to be 8-byte
  aligned so adjust the bus_dma_tag_create(9) accordingly.
- Unlike the rest of the controllers supported by this driver, the
  ALi M5451 only has 32 hardware channels instead of 64 so limit the
  loop in tr_intr() accordingly. [1]

Submitted by:	yongari [1]
Reviewed by:	yongari (superset of what is committed)
Approved by:	re (kib)
2009-09-25 19:59:18 +00:00
Alexander Motin
b8b5722c5d Remove constraint, requiring request data to fulfill controller's
alignment requirements. It is busdma task, to manage proper alignment by
loading data to bounce buffers.

PR:		kern/127316
Reviewed by:	current@
Tested by:	Ryan Rogers
Approved by:	re (kib)
2009-09-25 18:07:23 +00:00
Alexander Motin
2adf464fea MFC rev. 197462:
Do not call BUS_DRIVER_ADDED() for detached buses (attach failed) on
driver load. This fixes crash on atapicam module load on systems, where
some ata channels (usually ata1) was probed, but failed to attach.

Reviewed by:    jhb, imp
Tested by:      many
Approved by:    re (kib)
2009-09-25 18:04:55 +00:00
Marcel Moolenaar
3b9790003e MFC rev 197449:
Don't create more partitions than can fit in the table by checking
that the index is within bounds.

Approved by:	re (kib)
2009-09-25 17:48:30 +00:00
Marius Strobl
54577e2314 - Add missing bus_dmamap_sync(9) calls for the work DMA map. Previously
the work area was totally unsynchronized which means this driver only
  had a chance of working on x86 when no bounce buffers were involved,
  which isn't that likely given that support for 64-bit DMA is currently
  broken throughout ata(4).
- Add necessary little-endian conversion of accesses to the work area,
  making this driver work on big-endian hosts. While at it, use the
  alignment-agnostic byte order encoders in order to be on the safe side.
- Clear the reserved member of the SG list entries in order to be on the
  safe side. [1]

Submitted by:	yongari [1]
Reviewed by:	yongari
Approved by:	re (kib)
2009-09-25 16:45:27 +00:00
John Baldwin
424b2e64a2 MFC 197415:
The elements in the component arrays may be direct Package objects rather
than references to objects.  In that case, simply use the Package directly.

Approved by:	re (kib)
2009-09-25 15:14:11 +00:00
John Baldwin
57a0ee4c0b MFC 197410:
- Split the logic to parse an SMAP entry out into a separate function on
  amd64 similar to i386.  This fixes a bug on amd64 where overlapping
  entries would not cause the SMAP parsing to stop.
- Change the SMAP parsing code to do a sorted insertion into physmap[]
  instead of an append to support systems with out-of-order SMAP entries.

Approved by:	re (kib)
2009-09-25 15:08:26 +00:00
John Baldwin
b10d205de2 MFC 197406:
Don't reread the command register to see if enabling I/O or memory
decoding "took".  Other OS's that I checked do not do this and it breaks
some amdpm(4) devices.  Prior to 7.2 we did not honor the error returned
when this failed anyway, so this in effect restores previous behavior.

Approved by:	re (kib)
2009-09-25 14:58:00 +00:00
Brooks Davis
7bd26ba4cc MFC r197269:
Allocate space for the group array in a static credential used in
the quota code.  One case was correctly handled in r194498, but
this one was missed.

PR:		kern/138657
Tested by:	PR submitter
MFC after:	3 days
Approved by:	re@ (kib)
2009-09-24 21:32:56 +00:00
John Baldwin
4e36c32793 MFC 197350:
Re-remove the IBM0057 ID used for PS/2 mouse controllers.  The asl for the
61p includes the hotkey device as IBM0068 and the mouse as IBM0057 similar
to other systems.

Approved by:	re (kensmith)
2009-09-23 15:56:09 +00:00
Konstantin Belousov
2c5f9fbe6a MFC r197348:
For a.out and pre-8 ELF binaries, allow the mmap of zero length.

Approved by:	re (kensmith)
2009-09-23 13:49:41 +00:00
Rui Paulo
d414bb00bb MFC 197190:
Make the sudden motion sensor work on older models and add a bit of
 debugging.

 Submitted by:	Christoph Langguth <christoph at rosenkeller.org>

Approved by:	re (kib)
2009-09-22 20:31:32 +00:00
Qing Li
8cb7f8f861 MFC r197364
A wrong variable is used when setting up the interface
address route, which broke source address selection in
some code paths.

Submitted by:	noted by bz
Reviewed by:	hrs
Approved by:	re (kib)
2009-09-20 17:46:56 +00:00
Andriy Gapon
1a7268649b MFC r197099: pci(4): don't perform maximum register number check
Different sub-kinds of PCI buses may have different rules and
thus it is up for the bus backends to do proper input checks.
For example, PCIe allows configuration register numbers < 0x1000,
while for PCI proper the limit is 0x100.
And, in fact, the buses already do the checks.

Reviewed by:	jhb
Approved by:	re (kib)
2009-09-19 08:13:10 +00:00
Nathan Whitehorn
3f12b2cdd4 MFC r197080
Add a few SCSI controllers to GENERIC that can be found in Powermacs.
This allows installation onto SCSI disks as shipped, for example,
as an option with the Powermac G3.

PR:		powerpc/138543
Reviewed by:	grehan
Approved by:	re (kib)
Obtained from:	sparc64
2009-09-19 01:49:36 +00:00
Nathan Whitehorn
ec46867105 MFC r196993
Remove some debugging (KTR_VERBOSE) that crept into ppc GENERIC long ago
and is present on no other architectures by default.

Reviewed by:	grehan
Approved by:	re (kib)
2009-09-19 01:48:12 +00:00
Kenneth D. Merry
43eb6aeda0 Merge change r197208 from head to stable/8:
Fix some instances where CAM rescans get hung up or take a long time to
complete.

Also, allow xpt_rescan() to rescan a LUN instead of a full bus.

Sponsored by:	Copan Systems, Inc.
Approved by:	re (kib)
2009-09-18 20:35:05 +00:00
Yoshihiro Takahashi
9febd63ce1 MFC: r197156
MFi386:

  Move the loader's entry point to 0x200000.  This change is also needed
  for pc98.

Approved by:	re (kensmith)
2009-09-17 14:12:21 +00:00
Ken Smith
5895f2dd9f Get ready for 8.0-RC1 builds.
Approved by:	re (implicit)
2009-09-17 14:05:06 +00:00
Bruce M Simpson
bfcfe77605 MFC revs 197129,197130,197132:
Fixes to mcast userland API.
--
  Fix an API issue in leave processing for IPv4 multicast groups.
   * Do not assume that the group lookup performed by imo_match_group()
     is valid when ifp is NULL in this case.
   * Instead, return EADDRNOTAVAIL if the ifp cannot be resolved for the
     membership we are being asked to leave.

  Caveat user:
   * The way IPv4 multicast memberships are implemented in the inpcb layer
     at the moment, has the side-effect that struct ip_moptions will
     still hold the membership, under the old ifp, until ip_freemoptions()
     is called for the parent inpcb.
   * The underlying issue is: the inpcb layer does not get notification
     of ifp being detached going away in a thread-safe manner.
     This is non-trivial to fix.
--
  Fix an obvious logic error in the IPv4 multicast leave processing,
  where the filter mode vector was not updated correctly after the leave.
--
  Tighten input checking in inp_join_group():
   * Don't try to use the source address, when its family is unspecified.
   * If we get a join without a source, on an existing inclusive
     mode group, this is an error, as it would change the filter mode.

  Fix a problem with the handling of in_mfilter for new memberships:
   * Do not rely on imf being NULL; it is explicitly initialized to a
     non-NULL pointer when constructing a membership.
   * Explicitly initialize *imf to EX mode when the source address
     is unspecified.
  This fixes a problem with in_mfilter slot recycling in the join path.
--
  Don't allow joins w/o source on an existing group.
  This is almost always pilot error.

  We don't need to check for group filter UNDEFINED state at t1,
  because we only ever allocate filters with their groups, so we
  unconditionally reject such calls with EINVAL.
  Trying to change the active filter mode w/o going through IP_MSFILTER
  is also disallowed.

  Deals with the case described in PR 137164 upfront, cumulative
  with the fix in svn rev 197132 which only calls imo_match_source()
  if the source address family was not unspecified.
--

Revision 197136 has a text conflict, however it is a comment only change.

PR:		137164, 138689, 138690, 138691
Submitted by:	Stef Walter (with fixups)
Approved by:	re (kib)
2009-09-17 13:41:59 +00:00
Andriy Gapon
04793894d4 MFC r197077: pci: remove definitions of duplicate constants
Suggested by:	jhb
Reviewed by:	jhb
Approved by:	re (kib)
2009-09-17 12:41:27 +00:00
Marko Zec
1fe6ff9267 MFC r197176:
Lock the ifnet list while iterating over it.

  Submitted by: julian
  MFC after:    3 days

Approved by:	re (kensmith)
2009-09-17 11:03:37 +00:00
Scott Long
24048b0cb3 Merge rev 197263:
- Enable MSI support (MSIX support was already present)
- Performance improvements

Approved by:	re
Obtained from:	Yahoo!
2009-09-17 05:30:55 +00:00
Scott Long
053351cec3 Merge r197260, r197261, r197262
- Prevent a panic on modern controllers by increasing CISS_MAX_PHYSTGT to 256
- Fix MSI and PERFORMANT interrupt programming.  Fixes hang on boot.
- Fix locking bugs in ioctl handler

Most of this has been soaking at Yahoo for several months, if not longer.  The
quick MFC is due to the impending 8.0-RC1 build.

Approved by:	re
Obtained from:	Yahoo!
2009-09-17 05:27:32 +00:00
Michael Tuexen
6b3c18a020 MFC 197257:
Fix a bug reported by Daniel Mentz:
When authenticating DATA chunks some DATA chunks
might get stuck when the MTU gets decreased via
an ICMP message.

Approved by: re, rrs (mentor)
2009-09-16 14:47:50 +00:00
Michael Tuexen
04a34c6c34 Fixes two bugs:
1) A lock issue, if we ever had to try again
   we would double lock the INP lock.
2) We were allowing (at wrap) associd 0... which really
   we cannot allow since 0 normally means in most socket
   API calls that we are wishing to effect something on
   the INP not TCB.

Approved by: re, rrs (mentor)
2009-09-16 13:44:12 +00:00
Konstantin Belousov
9f1fab5064 MFC r197049:
Calculate the amount of bytes to copy for select filedescriptor masks
taking into account size of fd_set for the current process ABI.

Approved by:	re (kensmith)
2009-09-16 13:24:37 +00:00
Rafal Jaworowski
e9667e8ff1 MFC r196531-196534,196536
Clean up Marvell platform code.

Introduce SheevaPlug support.

   - The device is based on Marvell 88F6281 system on chip.
   - More info about the platform at http://www.plugcomputer.org

   - To build the FreeBSD kernel:
     make buildkernel TARGET_ARCH=arm KERNCONF=SHEEVAPLUG

   - Installation notes at: http://wiki.freebsd.org/FreeBSDMarvell

Submitted by:	Michal Hajduk
Approved by:	re (kib)
Obtained from:	Semihalf
2009-09-16 12:07:58 +00:00
Qing Li
553a7dec4b MFC r197227
Self pointing routes are installed for configured interface addresses
and address aliases. After an interface is brought down and brought
back up again, those self pointing routes disappeared. This patch
ensures after an interface is brought back up, the loopback routes
are reinstalled properly.

Reviewed by:	bz
Approved by:	re
2009-09-15 22:46:06 +00:00
Qing Li
bb3b75e86f MFC r197225
This patch enables the node to respond to ARP requests for
configured proxy ARP entries.

Reviewed by:	bz
Approved by:	re
2009-09-15 22:37:17 +00:00
Qing Li
77eb2069ce MFC r197210, 197212, 197235
The bootp code installs an interface address and the nfs client
module tries to install the same address again. This extra code
is removed, which was discovered by the removal of a call to
in_ifscrub() in r196714. This call to in_ifscrub is put back here
because the SIOCAIFADDR command can be used to change the prefix
length of an existing alias.

r197235 reverts file nfs_vfsops.c

Reviewed by:	kmacy
Approved by:	re
2009-09-15 22:25:19 +00:00
Qing Li
6d8337ba49 MFC r196714
This patch fixes the following issues:

- Routing messages are not generated when adding and removing
  interface address aliases.
- Loopback route installed for an interface address alias is
  not deleted from the routing table when that address alias
  is removed from the associated interface.
- Function in_ifscrub() is called extraneously.

Reviewed by:	gnn, kmacy, sam
Approved by:	re
2009-09-15 19:58:33 +00:00
Qing Li
599f45c5dd MFC r197203
Previously local end of point-to-point interface is not reachable
within the system that owns the interface. Packets destined to
the local end point leak to the wire towards the default gateway
if one exists. This behavior is changed as part of the L2/L3
rewrite efforts. The local end point is now reachable within the
system. The inpcb code needs to consider this fact during the
address selection process.

Reviewed by:	bz
Approved by:	re
2009-09-15 19:38:29 +00:00
Attilio Rao
623b4aa57e MFC r197224:
Use explicit int values for the device states in order to allow, if
necessary, in the future, adds of new states without breaking ABI
between revisions.

Please note that this is a special condition as we want this fix in
before RC1 as we assume it is critical and so it has been handled
as an instant-merge.

Approved by:	re (kib)
2009-09-15 19:24:18 +00:00
Attilio Rao
9cede8fb41 MFC r197223:
Fix sched_switch_migrate() by assuming locks cannot be shared and a
deadlock between 3 different threads by acquiring both runqueue locks
when doing the migration.

Please note that this is a special condition as we want this fix in
before RC1 as we assume it is critical and so it has been handled
as an instant-merge.  For the STABLE_7 branch, 1 week before the MFC
is assumed.

Approved by:	re (kib)
2009-09-15 19:14:25 +00:00
Konstantin Belousov
4dec4ece5a MFC r196888:
The clear_remove() and clear_inodedeps() call vn_start_write(NULL, &mp,
V_NOWAIT) on the non-busied mount point. Unmount might free ufs-specific
mp data, causing ffs_vgetf() to access freed memory.

Busy mountpoint before dropping softdep lk.

Approved by:	re (kensmith)
2009-09-15 12:51:22 +00:00
Pawel Jakub Dawidek
9c0bf68299 MFC r197218:
We believe ZFS is ready for production use. Remove a warning about it being
experimental. :)

Approved by:	re (kib)
2009-09-15 12:21:06 +00:00
Pawel Jakub Dawidek
26e71a6c1b MFC r197219:
Forced unmounts work just fine in my tests under heavy load. There might
still be a problem, but it isn't worth a warning.

Approved by:	re (kib)
2009-09-15 12:19:34 +00:00
Pawel Jakub Dawidek
6bd6f55621 MFC r196822, r196823, r196824:
Remove 'ad:' prefix from disk serial number. We don't want serial number
to change when we reconnect the disk in a way that it is accessible through
CAM for example.

Discussed with:	trasz

Simplify g_disk_ident_adjust() function and allow any printable character
in serial number.

Discussed with:	trasz
Obtained from:	Wheel Sp. z o.o. (http://www.wheel.pl)

Make serial numbers of daX disks visible by GEOM.

No objections from:	scottl
Obtained from:	Wheel Sp. z o.o. (http://www.wheel.pl)

Approved by:	re (kib)
2009-09-15 11:23:59 +00:00
Pawel Jakub Dawidek
055f4e2cf8 MFC r197039, r197040:
Fix usecount leak in mknod(2) on file system exported over NFS.

While I'm here, correct typo in comment.

Reviewed by:	kan, kib
Approved by:	re (bz)
2009-09-15 11:20:23 +00:00
Pawel Jakub Dawidek
18713ab672 MFC r196456,r196457,r196458,r196662,r196702,r196703,r196919,r196927,r196928,
r196943,r196944,r196947,r196950,r196953,r196954,r196965,r196978,r196979,
r196980,r196982,r196985,r196992,r197131,r197133,r197150,r197151,r197152,
r197153,r197167,r197172,r197177,r197200,r197201:

r196456:
- Give minclsyspri and maxclsyspri real values (consulted with kmacy).
- Honour 'pri' argument for thread_create().

r196457:
Set priority of vdev_geom threads and zvol threads to PRIBIO.

r196458:
- Hide ZFS kernel threads under zfskern process.
- Use better (shorter) threads names:
	'zvol:worker zvol/tank/vol00' -> 'zvol tank/vol00'
	'vdev:worker da0' -> 'vdev da0'

r196662:
Add missing mountpoint vnode locking.
This fixes panic on assertion with DEBUG_VFS_LOCKS and vfs.usermount=1 when
regular user tries to mount dataset owned by him.

r196702:
Remove empty directory.

r196703:
Backport the 'dirtying dbuf' panic fix from newer ZFS version.

Reported by:	Thomas Backman <serenity@exscape.org>

r196919:
bzero() on-stack argument, so mutex_init() won't misinterpret that the
lock is already initialized if we have some garbage on the stack.

PR:	kern/135480
Reported by:	Emil Mikulic <emikulic@gmail.com>

r196927:
Changing provider size is not really supported by GEOM, but doing so when
provider is closed should be ok.
When administrator requests to change ZVOL size do it immediately if ZVOL
is closed or do it on last ZVOL close.

PR:	kern/136942
Requested by:	Bernard Buri <bsd@ask-us.at>

r196928:
Teach zdb(8) how to obtain GEOM provider size.

PR:	kern/133134
Reported by:	Philipp Wuensche <cryx-freebsd@h3q.com>

r196943:
- Avoid holding mutex around M_WAITOK allocations.
- Add locking for mnt_opt field.

r196944:
Don't recheck ownership on update mount. This will eliminate LOR between
vfs_busy() and mount mutex. We check ownership in vfs_domount() anyway.

Noticed by:	kib
Reviewed by:	kib

r196947:
Defer thread start until we set priority.

Reviewed by:	kib

r196950:
Fix detection of file system being shared. Now zfs unshare/destroy/rename
command will properly remove exported file systems.

r196953:
When snapshot mount point is busy (for example we are still in it)
we will fail to unmount it, but it won't be removed from the tree,
so in that case there is no need to reinsert it.

Reported by:	trasz

r196954:
If we have to use avl_find(), optimize a bit and use avl_insert() instead of
avl_add() (the latter is actually a wrapper around avl_find() + avl_insert()).
Fix similar case in the code that is currently commented out.

r196965:
Fix reference count leak for a case where snapshot's mount point is updated.

r196978:
Call ZFS_EXIT() after locking the vnode.

r196979:
On FreeBSD we don't have to look for snapshot's mount point,
because fhtovp method is already called with proper mount point.

r196980:
When we automatically mount snapshot we want to return vnode of the mount point
from the lookup and not covered vnode. This is one of the fixes for using .zfs/
over NFS.

r196982:
We don't export individual snapshots, so mnt_export field in snapshot's
mount point is NULL. That's why when we try to access snapshots over NFS
use mnt_export field from the parent file system.

r196985:
Only log successful commands! Without this fix we log even unsuccessful
commands executed by unprivileged users. Action is not really taken, but it is
logged to pool history, which might be confusing.

Reported by:	Denis Ahrens <denis@h3q.com>

r196992:
Implement __assert() for Solaris-specific code. Until now Solaris code was
using Solaris prototype for __assert(), but FreeBSD's implementation.
Both take different arguments, so we were either core-dumping in assert()
or printing garbage.

Reported by:	avg

r197131:
Tighten up the check for race in zfs_zget() - ZTOV(zp) can not only contain
NULL, but also can point to dead vnode, take that into account.

PR:	kern/132068
Reported by:	Edward Fisk <7ogcg7g02@sneakemail.com>, kris
Fix based on patch from:	Jaakko Heinonen <jh@saunalahti.fi>

r197133:
- Protect reclaim with z_teardown_inactive_lock.
- Be prepared for dbuf to disappear in zfs_reclaim_complete() and check if
  z_dbuf field is NULL - this might happen in case of rollback or forced
  unmount between zfs_freebsd_reclaim() and zfs_reclaim_complete().
- On forced unmount wait for all znodes to be destroyed - destruction can be
  done asynchronously via zfs_reclaim_complete().

r197150:
There is a bug where mze_insert() can trigger an assert() of inserting
the same entry twice. This bug is not fixed yet, but leads to situation
where when try to access corrupted directory the kernel will panic.
Until the bug is properly fixed, try to recover from it and log that it
happened.

Reported by:	marck
OpenSolaris bug:	6709336

r197151:
Be sure not to overflow struct fid.

r197152:
Extend scope of the z_teardown_lock lock for consistency and "just in case".

r197153:
When zfs.ko is compiled with debug, make sure that znode and vnode point at
each other.

r197167:
Work-around READDIRPLUS problem with .zfs/ and .zfs/snapshot/ directories
by just returning EOPNOTSUPP. This will allow NFS server to fall back to
regular READDIR.
Note that converting inode number to snapshot's vnode is expensive operation.
Snapshots are stored in AVL tree, but based on their names, not inode numbers,
so to convert inode to snapshot vnode we have to interate over all snalshots.
This is not a problem in OpenSolaris, because in their READDIRPLUS
implementation they use VOP_LOOKUP() on d_name, instead of VFS_VGET() on
d_fileno as we do.

PR:	kern/125149
Reported by:	Weldon Godfrey <wgodfrey@ena.com>
Analysis by:	Jaakko Heinonen <jh@saunalahti.fi>

r197172:
Add missing \n.

Reported by:	marck

r197177:
Support both case: when snapshot is already mounted and when it is not yet
mounted.

r197200:
Modify mount(8) to skip MNT_IGNORE file systems by default, just like df(1)
does. This is not POLA violation, because there is no single file system in the
base that use MNT_IGNORE currently, although ZFS snapshots will be mounted with
MNT_IGNORE after next commit.

Reviewed by:	kib

r197201:
- Mount ZFS snapshots with MNT_IGNORE flag, so they are not visible in regular
  df(1) and mount(8) output. This is a bit smilar to OpenSolaris and follows
  ZFS route of not listing snapshots by default with 'zfs list' command.
- Add UPDATING entry to note that ZFS snapshots are no longer visible in
  mount(8) and df(1) output by default.

Reviewed by:	kib

Approved by:	re (bz)
2009-09-15 11:13:40 +00:00
John Baldwin
3c31e305c0 MFC 197062:
Don't malloc a buffer while holding the prison0 mutex.  Instead, use a loop
where we figure out the hostname length under the lock, malloc the buffer
with the lock dropped, then recheck the length under the lock and loop again
if the buffer is now too small.

Approved by:	re (kib)
2009-09-14 16:13:12 +00:00