]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoMFC: fix the build when MODULES_WITH_WORLD is defined.
ru [Wed, 1 Oct 2008 06:17:15 +0000 (06:17 +0000)]
MFC: fix the build when MODULES_WITH_WORLD is defined.

Approved by: re (kib)

15 years agoSync with head: When copying out the kld_stat structure to userland, only
jhb [Tue, 30 Sep 2008 15:49:59 +0000 (15:49 +0000)]
Sync with head: When copying out the kld_stat structure to userland, only
copy out the size of the user's buffer.  In the case of a program using
the older (smaller) structure, the previous code would trash memory after
the end of the user's kld_stat struct.  This was missed in the DTrace
MFC.

Submitted by: Jaakko Heinonen  jh saunalahti.fi
Approved by: re (kib)

15 years agoMFC r183383:
kib [Mon, 29 Sep 2008 20:20:13 +0000 (20:20 +0000)]
MFC r183383:
Save previous content of the td_fpop before storing the current
filedescriptor into it. Make sure that td_fpop is NULL when calling
d_mmap from dev_pager_getpages().

Approved by: re (kensmith)

15 years agoMFC r183216:
kib [Mon, 29 Sep 2008 20:06:57 +0000 (20:06 +0000)]
MFC r183216:
Allow the d_mmap driver methods to use cdevpriv KPI during verification
phase of establishing mapping.

Approved by: re (rwatson)

15 years agoMFC of the r179312 by sos:
kib [Mon, 29 Sep 2008 19:54:38 +0000 (19:54 +0000)]
MFC of the r179312 by sos:
Do not call ata_start() when ata_reinit fails in the ioctl path.

Approved by: re (kensmith), sos
Prodded by: Andrey V. Elsukov <bu7cher@yandex.ru>

15 years agoMerge r183418 from head to stable/7:
rwatson [Mon, 29 Sep 2008 19:19:27 +0000 (19:19 +0000)]
Merge r183418 from head to stable/7:

  When an inpcb doesn't have a socket but the inpcb is passed to ipfw
  in the transmit path, such as TCPS_TIMEWAIT, fail the credential
  extraction immediately rather than acquiring locks and looking up
  the inpcb on the global lists in order to reach the conclusion that
  the credential extraction has failed.

  This is more efficient, but more importantly, it avoids lock
  recursion on the inpcbinfo, which is no longer allowed with rwlocks.
  This appears to have been responsible for at least two reported
  panics.

  Reported by:        ganbold

Approved by: re (kib)

15 years agoMerge r183398 from head to stable/7:
rwatson [Mon, 29 Sep 2008 19:10:30 +0000 (19:10 +0000)]
Merge r183398 from head to stable/7:

  Rather than shadowing global variable 'lookup' in check_uidgid(), rename
  it to ugid_lookupp.  This should make debugging issues with ipfw uid
  rules easier.

Approved by: re (kib)

15 years agoMerge r183356 from head to stable/7:
rwatson [Mon, 29 Sep 2008 18:23:08 +0000 (18:23 +0000)]
Merge r183356 from head to stable/7:

  As a follow-on to r183323, correct another case where ip_output() was
  called without an inpcb pointer despite holding the tcbinfo global
  lock, which lead to a deadlock or panic when ipfw tried to further
  acquire it recursively.

  Reported by:    Stefan Ehmann <shoesoft at gmx dot net>

Approved by: re (kib)

15 years agoMerge r183323 from head to stable/7:
rwatson [Mon, 29 Sep 2008 15:19:37 +0000 (15:19 +0000)]
Merge r183323 from head to stable/7:

  When dropping a packet and issuing a reset during TCP segment handling,
  unconditionally drop the tcbinfo lock (after all, we assert it lines
  before), but call tcp_dropwithreset() under both inpcb and inpcbinfo
  locks only if we pass in an tcpcb.  Otherwise, if the pointer is NULL,
  firewall code may later recurse the global tcbinfo lock trying to look
  up an inpcb.

  This is an instance where a layering violation leads not only
  potentially to code reentrace and recursion, but also to lock
  recursion, and was revealed by the conversion to rwlocks because
  acquiring a read lock on an rwlock already held with a write lock is
  forbidden.  When these locks were mutexes, they simply recursed.

  Reported by:        Stefan Ehmann <shoesoft at gmx dot net>

Approved by: re (kib)

15 years agoMFC r179005 (by phk):
kib [Mon, 29 Sep 2008 14:33:04 +0000 (14:33 +0000)]
MFC r179005 (by phk):
Don't terminate if we are listing devices, a controller might
legitimately not be there.

Submitted by: Andrey V. Elsukov <bu7cher@yandex.ru>
Approved by: re (gnn), phk

15 years agoMFC 183339
kmacy [Fri, 26 Sep 2008 05:09:03 +0000 (05:09 +0000)]
MFC 183339
insta-panic fix

tested by: gnn

Submitted by: Chelsio Inc.
Approved by: re

15 years agoMFC r183264:
yongari [Fri, 26 Sep 2008 00:52:51 +0000 (00:52 +0000)]
MFC r183264:
  Add workaround for occasional packet loss issue of JMC250 A2
  when it runs on half-duplex media.
  While I'm here add register definition for GPREG1. ATM the GPREG1
  register is only valid for JMC250 A1/A2.

  Submitted by: Ethan at JMicron

Approved by: re (kensmith)

15 years agoMFC: 178280
jhb [Thu, 25 Sep 2008 18:37:08 +0000 (18:37 +0000)]
MFC: 178280
- Clean up the code that checks the types of address so that it is
  done by understandable macros.
- Fix the bug that prevented the system from responding on interfaces with
  link local addresses assigned.

Approved by: re (gnn)

15 years agoMFC:
dwmalone [Thu, 25 Sep 2008 14:24:07 +0000 (14:24 +0000)]
MFC:
Lockf was exiting with status 1 if the command did not exit normally.
This is easy to confuse with the actual exit status of the program.
Instead exit with EX_SOFTWARE if the command doesn't exit normally.

Approved by: re (kib)

15 years agoMFC r183236
alc [Thu, 25 Sep 2008 06:11:58 +0000 (06:11 +0000)]
MFC r183236
  Prevent an integer overflow in vm_pageout_page_stats() on machines with a
  large number of physical pages.

PR: 126158
Approved by: re (kib)

15 years agoMFC: 176526,176596
jhb [Wed, 24 Sep 2008 17:49:26 +0000 (17:49 +0000)]
MFC: 176526,176596
- Correct a long-standing error in vm_object_deallocate().  Specifically,
  only anonymous default (OBJT_DEFAULT) and swap (OBJT_SWAP) objects should
  ever have OBJ_ONEMAPPING set.  However, vm_object_deallocate() was
  setting it on device (OBJT_DEVICE) objects.  As a result,
  vm_object_page_remove() could be called on a device object and if that
  occurred pmap_remove_all() would be called on the device object's pages.
  However, a device object's pages are fictitious, and fictitious pages do
  not have an initialized pv list (struct md_page).
- Correct a long-standing error in vm_object_page_remove().  Specifically,
  pmap_remove_all() must not be called on fictitious pages.  To date,
  fictitious pages have been allocated from zeroed memory, effectively
  hiding this problem because the fictitious pages appear to have an empty
  pv list.
- Rewrite the comments describing vm_object_page_remove() to better
  describe what it does.  Add an assertion.

Approved by: re (kib), alc

15 years agoMerge r183265 from head to stable/7:
rwatson [Tue, 23 Sep 2008 21:29:22 +0000 (21:29 +0000)]
Merge r183265 from head to stable/7:

  When invoking the udp_send() from udp6_send() due to use of a v6-mapped
  IPv4 address, first drop the udbinfo and inpcb locks, which will otherwise
  be recursed.  This leads to a potential minor race, but is preferable to a
  deadlock when acquiring a read lock after a write lock on the inpcb.

  MFC after:    3 days
  Reported by:  Norbert Papke <fbsd-ml@scrapper.ca>, lioux

Approved by: re (kib)
Tested by: Norbert Papke <fbsd-ml@scrapper.ca>, lioux

15 years agoMFC: Add a CTASSERT() that KERNBASE is valid and update the KVA_PAGES
jhb [Tue, 23 Sep 2008 18:33:11 +0000 (18:33 +0000)]
MFC: Add a CTASSERT() that KERNBASE is valid and update the KVA_PAGES
comments to cover PAE.

Approved by: re (kib)

15 years agoMFC r182961:
kib [Tue, 23 Sep 2008 17:41:15 +0000 (17:41 +0000)]
MFC r182961:
When doing rfork(0), i.e. separating curproc VM from any other user of
the same vmspace, decrement the reference count of the shared LDT instead
of a newly-made copy. Code factually removed LDT from the process that
did rfork(0).

Introduce user_ldt_deref() function that does decrement of refcount for
the struct proc_ldt, and call it in the rfork(0) case on the shared LDT.

Approved by: re (kensmith)

15 years agoMFC r182960 (with XEN-related chunks removed):
kib [Tue, 23 Sep 2008 17:23:59 +0000 (17:23 +0000)]
MFC r182960 (with XEN-related chunks removed):
The user_ldt_alloc() function shall return with dt_lock locked.
The user_ldt_free() function shall return with dt_lock unlocked.
Error handling code in both functions do not handle this, fix it by
doing necessary lock/unlock.

While there, fix minor style nits.

Approved by: re (kensmith)

15 years agoMFC r182959:
kib [Tue, 23 Sep 2008 17:16:24 +0000 (17:16 +0000)]
MFC r182959:
Remove warning about static LDT segment allocation. Applications
continue using it after ~7 years since warning was introduced, and there
is no reason to discourage them.

Approved by: re (kensmith)

15 years agoMFC: 179296
jhb [Tue, 23 Sep 2008 16:03:32 +0000 (16:03 +0000)]
MFC: 179296
To date, our implementation of munmap(2) has required that the
entirety of the specified range be mapped.  Specifically, it has
returned EINVAL if the entire range is not mapped.  There is not,
however, any basis for this in either SuSv2 or our own man page.
Moreover, neither Linux nor Solaris impose this requirement.  This
revision removes this requirement.

Approved by: re (kib)

15 years agoMFC: 179623
jhb [Tue, 23 Sep 2008 15:59:38 +0000 (15:59 +0000)]
MFC: 179623
Essentially, neither madvise(..., MADV_DONTNEED) nor madvise(..., MADV_FREE)
work.  (Moreover, I don't believe that they have ever worked as intended.)
The explanation is fairly simple.  Both MADV_DONTNEED and MADV_FREE perform
vm_page_dontneed() on each page within the range given to madvise().  This
function moves the page to the inactive queue.  Specifically, if the page is
clean, it is moved to the head of the inactive queue where it is first in
line for processing by the page daemon.  On the other hand, if it is dirty,
it is placed at the tail.  Let's further examine the case in which the page
is clean.  Recall that the page is at the head of the line for processing by
the page daemon.  The expectation of vm_page_dontneed()'s author was that
the page would be transferred from the inactive queue to the cache queue by
the page daemon.  (Once the page is in the cache queue, it is, in effect,
free, that is, it can be reallocated to a new vm object by vm_page_alloc()
if it isn't reactivated quickly enough by a user of the old vm object.)  The
trouble is that nowhere in the execution of either MADV_DONTNEED or
MADV_FREE is either the machine-independent reference flag (PG_REFERENCED)
or the reference bit in any page table entry (PTE) mapping the page cleared.
Consequently, the immediate reaction of the page daemon is to reactivate the
page because it is referenced.  In effect, the madvise() was for naught.
The case in which the page was dirty is not too different.  Instead of being
laundered, the page is reactivated.

Note: The essential difference between MADV_DONTNEED and MADV_FREE is
that MADV_FREE clears a page's dirty field.  So, MADV_FREE is always
executing the clean case above.

This revision changes vm_page_dontneed() to clear both the machine-
independent reference flag (PG_REFERENCED) and the reference bit in all PTEs
mapping the page.

Approved by: re (kib), alc

15 years agoMFC: Fix vnode interlocking in QUOTA lock upgrade case in ufs_access().
jhb [Tue, 23 Sep 2008 15:57:39 +0000 (15:57 +0000)]
MFC: Fix vnode interlocking in QUOTA lock upgrade case in ufs_access().

Approved by: re (kib)

15 years agoMFC rev 1.5 (r182853)
matteo [Tue, 23 Sep 2008 12:17:20 +0000 (12:17 +0000)]
MFC rev 1.5 (r182853)
Use %d to print numfibs

Approved by: re

15 years agoMFC r180607 (by jeff):
kib [Tue, 23 Sep 2008 11:56:07 +0000 (11:56 +0000)]
MFC r180607 (by jeff):
Check whether we've recorded this tick in ts_ticks on another cpu in
sched_tick() to prevent multiple increments for one tick. This pushes
the value out of range and breaks priority calculation.

Approved by: re (rwatson)

15 years agoMFH: 182818, 182823, 182825, 183012 - IPFW_DEFAULT_RULE related fixes.
rik [Tue, 23 Sep 2008 10:36:37 +0000 (10:36 +0000)]
MFH: 182818, 182823, 182825, 183012 - IPFW_DEFAULT_RULE related fixes.

 New Revision: 182818
 URL: http://svn.freebsd.org/changeset/base/182818

 Log:
  Export the IPFW_DEFAULT_RULE outside ip_fw2.c.  This number in not only
  the default rule number but also the maximum rule number.  User space
  software such as ipfw and natd should be aware of its value.  The
  software that already includes ip_fw.h should use the defined value.  All
  other a expected to use sysctl (as discussed on net@).

  MFC after: 5 days.
  Discussed on: net@

 Modified:
  head/sys/netinet/ip_fw.h
  head/sys/netinet/ip_fw2.c

 New Revision: 182823
 URL: http://svn.freebsd.org/changeset/base/182823

 Log:
  Use IPFW_DEFAULT_RULE instead of hardcoded value since now it is
  available.

  MFC after:    5 days.

 Modified:
  head/sbin/ipfw/ipfw2.c

 New Revision: 182825
 URL: http://svn.freebsd.org/changeset/base/182825

 Log:
  Check rule numbers against maximum value to avoid rules cleanup due
  to overflow.

  MFC after:    5 days.

 Modified:
  head/sbin/natd/natd.c

 New Revision: 183012
 URL: http://svn.freebsd.org/changeset/base/183012

 Log:
  Make the commet for the default rule number more clear.

  Submitted by:    yar@

 Modified:
  head/sys/netinet/ip_fw.h

Approved by: re (kensmith)

15 years agoMerge r182892 from head to stable/7, I had to manually
rdivacky [Mon, 22 Sep 2008 20:19:54 +0000 (20:19 +0000)]
Merge r182892 from head to stable/7, I had to manually
change the code to include "thread" argument to the vn_lock()
which got removed in HEAD:

Getdents requires padding with 2 bytes instead of 1 byte
as with getdents64. The last byte is used for storing
the d_type, add this to plain getdents case where it was
missing before. Also change the code to use strlcpy instead
of plain strcpy. This changes fix the getdents crash we
had reports about (hl2 server etc.)

PR: kern/117010
MFC after: 1 week
Submitted by: Dmitry Chagin (dchagin@)
Tested by: MITA Yoshio <mita ee.t.u-tokyo.ac jp>
Approved by: kib (mentor)
Approved by: re (kensmith)

15 years agoMFC: r183190
jkim [Mon, 22 Sep 2008 15:57:58 +0000 (15:57 +0000)]
MFC: r183190

Clean up DSDT and XSDT correctly instead of FADT when the tables are bad.

Submitted by: jhb
Approved by: re (kib)

15 years agoMFC r183135
thompsa [Sun, 21 Sep 2008 06:01:03 +0000 (06:01 +0000)]
MFC r183135

 Make sure there is at least one port to avoid divide by zero when choosing the
 tx port.

Approved by: re (kensmith)

15 years agoCast bd_rcount, bd_dcount, and bd_fcount to intmax_t for printing
obrien [Fri, 19 Sep 2008 15:09:44 +0000 (15:09 +0000)]
Cast bd_rcount, bd_dcount, and bd_fcount to intmax_t for printing
until the base types for these are synced with 8-CURRENT.

Approved by: re(kensmith)

15 years agoMFC r182193 (libc part):
kib [Fri, 19 Sep 2008 13:32:17 +0000 (13:32 +0000)]
MFC r182193 (libc part):
Document WNOWAIT.

Approved by: re (kensmith)

15 years agoMFC r182193:
kib [Fri, 19 Sep 2008 09:48:25 +0000 (09:48 +0000)]
MFC r182193:
Implement WNOWAIT flag for wait4(2). It specifies that process whose status
is returned shall be kept in the waitable state.
Add WSTOPPED as an alias for WUNTRACED.

MFC r182424 (by davidxu):
Don't remove queued SIGCHLD if options contain WNOWAIT, so other
threads still can be notified by the signal.

Approved by: re (kensmith)

15 years agoMFC: r178692 - make sure we initialise delegated creds properly.
dfr [Fri, 19 Sep 2008 07:59:20 +0000 (07:59 +0000)]
MFC: r178692 - make sure we initialise delegated creds properly.
This fixes a crash in sshd when a user authenticates using GSS-API.

Approved by: re (kensmith)

15 years agoMFC r182808:
yongari [Fri, 19 Sep 2008 03:36:53 +0000 (03:36 +0000)]
MFC r182808:
  Read ethernet address from ID registers for RTL8102E/RTL8102EL as
  reading from EEPROM doesn't seem to work on these controllers.

  Reported by: Milan Obuch ( freebsd-net at dino dot sk )
  Tested by: Milan Obuch ( freebsd-net at dino dot sk )
  Approved by: re (kensmith)

15 years agoMFC r182777
thompsa [Fri, 19 Sep 2008 01:10:19 +0000 (01:10 +0000)]
MFC r182777

 Remove the alignment of the align parameter. This is up to the caller to pass
 in and it breaks tap(4) on strict alignment machines as m_uiotombuf is called
 with ETHER_ALIGN.

Approved by: re (kensmith)

15 years agoMFC: 182874
oleg [Thu, 18 Sep 2008 22:24:49 +0000 (22:24 +0000)]
MFC: 182874
bge_tick(): do not touch PHY if link is up. This should solve problem with
extra input errors for some BCM57XX chips.

PR: kern/122295
Approved by: re (kensmith)

15 years agoMFC: Update comments about the 0xcf9 register reset method.
jhb [Thu, 18 Sep 2008 20:20:00 +0000 (20:20 +0000)]
MFC: Update comments about the 0xcf9 register reset method.

Approved by: re (kensmith, kib)

15 years agoMFC: 180352
jhb [Wed, 17 Sep 2008 21:05:31 +0000 (21:05 +0000)]
MFC: 180352
In FreeBSD 7.0 and beyond, pmap_growkernel() should pass VM_ALLOC_INTERRUPT
to vm_page_alloc() instead of VM_ALLOC_SYSTEM.  VM_ALLOC_SYSTEM was the
logical choice before FreeBSD 7.0 because VM_ALLOC_INTERRUPT could not
reclaim a cached page.  Simply put, there was no ordering between
VM_ALLOC_INTERRUPT and VM_ALLOC_SYSTEM as to which "dug deeper" into the
cache and free queues.  Now, there is; VM_ALLOC_INTERRUPT dominates
VM_ALLOC_SYSTEM.

While I'm here, teach pmap_growkernel() to request a prezeroed page.

Approved by: re (kib), alc

15 years agoMFC: Recognize architectural support for 1GB virtual pages.
jhb [Wed, 17 Sep 2008 20:49:42 +0000 (20:49 +0000)]
MFC: Recognize architectural support for 1GB virtual pages.

Approved by: re (kib), alc

15 years agoMFC: 174104
jhb [Wed, 17 Sep 2008 20:38:18 +0000 (20:38 +0000)]
MFC: 174104
Improve get_pv_entry()'s handling of low-memory conditions.  After page
allocation fails and pv entries are reclaimed, there may be an unused pv
entry in a pv chunk that survived the reclamation.  However, previously,
after reclamation, get_pv_entry() did not look for an unused pv entry in
a surviving pv chunk; it simply retried the page allocation.  Now, it
does look for an unused pv entry before retrying the page allocation.

Note: This only applies to RELENG_7.  Earlier branches use a different
pv entry allocator.

Approved by: re (kib), alc

15 years agoMFC: Account for pv entry pages in the total number of wired pages.
jhb [Wed, 17 Sep 2008 20:34:02 +0000 (20:34 +0000)]
MFC: Account for pv entry pages in the total number of wired pages.
(Note: pv entry pages have always been included in the total number of
wired pages on i386 just not amd64.)

Approved by: re (kib), alc

15 years agoMFC: 173901,173918
jhb [Wed, 17 Sep 2008 20:30:42 +0000 (20:30 +0000)]
MFC: 173901,173918
- Tidy up: Add comments.  Eliminate the pointless
  malloc_type_allocated(..., 0) calls that occur when contigmalloc() has
  failed.  Eliminate the acquisition and release of the page queues lock
  from vm_page_release_contig().  Rename contigmalloc2() to
  contigmapping(), reflecting what it does.
- Make contigmalloc(9)'s page laundering more robust.  Specifically, use
  vm_pageout_fallback_object_lock() in vm_contig_launder_page() to better
  handle a lock-ordering problem.  Consequently, trylock's failure on the
  page's containing object no longer implies that the page cannot be
  laundered.

Approved by: re (kib), alc

15 years agoMFC: Disable the inline assembly crc32 routine and use the C version
jhb [Wed, 17 Sep 2008 20:14:19 +0000 (20:14 +0000)]
MFC: Disable the inline assembly crc32 routine and use the C version
instead.

Approved by: re (kib)

15 years agoMFC: Add a proper detach method to est(4).
jhb [Wed, 17 Sep 2008 20:12:24 +0000 (20:12 +0000)]
MFC: Add a proper detach method to est(4).

Approved by: re (kib)

15 years agoMerge English revisions as of 182972.
delphij [Wed, 17 Sep 2008 19:04:03 +0000 (19:04 +0000)]
Merge English revisions as of 182972.

Approved by: re (hrs)

15 years agoMFC: Add the dpms(4) driver to use the VESA BIOS for DPMS during suspend and
jhb [Wed, 17 Sep 2008 18:13:16 +0000 (18:13 +0000)]
MFC: Add the dpms(4) driver to use the VESA BIOS for DPMS during suspend and
resume.

Approved by: re (kensmith)

15 years agoMFC r182890:
kib [Wed, 17 Sep 2008 08:05:39 +0000 (08:05 +0000)]
MFC r182890:
Remove superfluous copyin() of args, structures are already in kernel space.

Approved by: re (kensmith)

15 years agoNote sendmail 8.14.3 upgrade
gshapiro [Wed, 17 Sep 2008 04:51:10 +0000 (04:51 +0000)]
Note sendmail 8.14.3 upgrade

Approved by: re (kib)

15 years agoMFC r182887-182888:
yongari [Wed, 17 Sep 2008 03:51:32 +0000 (03:51 +0000)]
MFC r182887-182888:
 r182887:
  Fix typo which resulted in invalid configuration for JMC260.

 r182888:
  Add workaround for CRC errors seen at 100Mbps on JMC250 A2.
  While here update chip revision number of JMC250/JMC260 from the
  latest datasheet.

Approved by: re (kensmith)

15 years agoMFC: Adjust the probe order further so that Host-PCI bridges are probed
jhb [Tue, 16 Sep 2008 20:07:08 +0000 (20:07 +0000)]
MFC: Adjust the probe order further so that Host-PCI bridges are probed
in the same order that they used to be probed.  Now we just give CPUs a
rediculously high order to ensure they are last.

Approved by: re (kib)

15 years agoMFC: Set UMA_ZONE_NOFREE for turnstiles so that the per-turnstile spin
jhb [Tue, 16 Sep 2008 20:04:37 +0000 (20:04 +0000)]
MFC: Set UMA_ZONE_NOFREE for turnstiles so that the per-turnstile spin
locks are type stable.

Approved by: re (kib)

15 years agoMFC: Close a race in sleepq_broadcast() where the sleepq could be reused
jhb [Tue, 16 Sep 2008 20:01:57 +0000 (20:01 +0000)]
MFC: Close a race in sleepq_broadcast() where the sleepq could be reused
after it had been assigned to the last sleeping thread.

Approved by: re (kib)

15 years agoConditionalize setting udp6_usrreqs.pru_soreceive to soreceive_dgram
rwatson [Tue, 16 Sep 2008 18:52:51 +0000 (18:52 +0000)]
Conditionalize setting udp6_usrreqs.pru_soreceive to soreceive_dgram
on #ifdef INET, as we don't define udp6_usrreqs when IPv6 isn't
compiled into the kernel.

Reported  by: bf <bf2006a at yahoo dot com>,
Kovacs Robert <robi at datanet.hu>
Approved by: re (kib)

15 years agoMFC of tzdata2008f - SVN rev 183066:
edwin [Tue, 16 Sep 2008 10:53:50 +0000 (10:53 +0000)]
MFC of tzdata2008f - SVN rev 183066:

Changes for Mauritius, Morocco, Pakistan, Palestine, Argentina and Brazil.

Approved by: re (kib@)

15 years agoMerge r180198, r180211, r180365, r182682 from head to stable/7:
rwatson [Mon, 15 Sep 2008 20:46:32 +0000 (20:46 +0000)]
Merge r180198, r180211, r180365, r182682 from head to stable/7:

  Add soreceive_dgram(9), an optimized socket receive function for use by
  datagram-only protocols, such as UDP.  This version removes use of
  sblock(), which is not required due to an inability to interlace data
  improperly with datagrams, as well as avoiding some of the larger loops
  and state management that don't apply on datagram sockets.

  This is experimental code, so hook it up only for UDPv4 for testing; if
  there are problems we may need to revise it or turn it off by default,
  but it offers *significant* performance improvements for threaded UDP
  applications such as BIND9, nsd, and memcached using UDP.

  Tested by:      kris, ps

  Update copyright date in light of soreceive_dgram(9).

  Use soreceive_dgram() and sosend_dgram() with UDPv6, as we do with UDPv4.

  Tested by:      ps

  Remove XXXRW in soreceive_dgram that proves unnecessary.

  Remove unused orig_resid variable in soreceive_dgram.

  Submitted by:   alfred

Note: in the MFC, we do enable sosend_dgram for UDPv6 by default (it was
already used for UDPv4), but use of soreceive_dgram for both UDPv4 and
UDPv6 is controlled by a new loader tunable,
net.inet.udp.soreceive_dgram_enabled as soreceive_dgram has less testing
exposure than sosend_dgram.  We may wish to change the default (and
eliminate the tunable) in 7.2.

MFC requested by: gnn, kris, ps
Approved by: re (kib)

15 years agoAdd missing hooks for DTRACE so that dtraceall.ko could be loaded.
mr [Mon, 15 Sep 2008 20:11:06 +0000 (20:11 +0000)]
Add missing hooks for DTRACE so that dtraceall.ko could be loaded.

Approved by: re (kosticbel)

15 years agoMFC r182868:
kib [Mon, 15 Sep 2008 19:51:32 +0000 (19:51 +0000)]
MFC r182868:
The pcb_gs32p should be per-cpu, not per-thread pointer. This is
location in GDT where the segment descriptor from pcb_gs32sd is
copied, and the location is in GDT local to CPU.

Approved by: re (kensmith)

15 years agoMFC r182867:
kib [Mon, 15 Sep 2008 19:47:59 +0000 (19:47 +0000)]
MFC r182867:
Provide private per-CPU GDTs on amd64.

Approved by: re (kensmith)

15 years agoMFC r182866:
kib [Mon, 15 Sep 2008 19:44:39 +0000 (19:44 +0000)]
MFC r182866:
In linux_set_thread_area(), mark pcb as PCB_GS32BIT.

Approved by: re (kensmith)

15 years agoMFC r182849:
kib [Mon, 15 Sep 2008 19:40:49 +0000 (19:40 +0000)]
MFC r182849:
Segment registers are stored in the uc_mcontext member of the struct
l_ucontext. To restore the registers content, trampoline needs to
dereference uc_mcontext instead of taking some undefined values from
l_ucontext.

Approved by: re (kensmith)

15 years agoMFC r182865:
kib [Mon, 15 Sep 2008 09:35:29 +0000 (09:35 +0000)]
MFC r182865:
Fix inconsistencies in the comments.

Approved by: re (blackend)

15 years agoMFC: r182688
marius [Sat, 13 Sep 2008 15:17:21 +0000 (15:17 +0000)]
MFC: r182688

Bypass isa_probe_children(9) and directly call bus_generic_attach(9)
in order to avoid the invasive probes done by identify-routines of
ISA drivers, which may access unassigned addresses or those of
unrelated devices and thus in turn can trigger master/target aborts
as revealed by r182108 and ahc(4). I think that this is also the
cause of the hang previously seen on B100 blades during boot.
Bypassing isa_probe_children(9) also avoids adding ISA hints, which
just can be wrong for sparc64.

Approved by: re (kib)

15 years agoMFC r182749
mav [Sat, 13 Sep 2008 07:36:16 +0000 (07:36 +0000)]
MFC r182749

Add one more SII3132 chip PCI ID found on Adaptec Serial ATA II RAID 1220SA.

Submitted by: Dmitry S. Luhtionov <mitya@cabletv.dp.ua>

Approved by: re (kib)

15 years agoExtend global UNIX domain socket rwlock coverage to include incrementing
rwatson [Sat, 13 Sep 2008 00:16:20 +0000 (00:16 +0000)]
Extend global UNIX domain socket rwlock coverage to include incrementing
and decrementing unp_rights, which may otherwise be corrupted.  Be
slightly more conversative in where we read unp_rights.

This relates to one of the symptoms reported in the noted PR, but may not
correct the actual high system time problem.  The reporter has confirmed
stability but not that the problem is eliminated.  However, this is a
useful fix to a clear locking bug.

Note that this is not an MFC as the UNIX domain socket garbage collector
has been replaced in 8.x.

PR: 127024
Reported by: Anton Yuzhaninov <citrin at citrin dot ru>
Reviewed by: kib
Approved by: re (kib)

15 years agoMFH r182857:
roberto [Fri, 12 Sep 2008 22:18:35 +0000 (22:18 +0000)]
MFH r182857:
  Apply updated patch from bin/92839 to avoid two possible buffer overflows.
PR: bin/92839
Submitted by: Helge Oldach <freebsdntpd@oldach.net>
Approved by: re (gnn)

15 years agoMFH r182944:
roberto [Fri, 12 Sep 2008 22:15:43 +0000 (22:15 +0000)]
MFH r182944:
  Makefile.inc already defines OPENSSL if crypto is available/wanted.

PR: bin/127296
Submitted by: olivier
Approved by: re (gnn)

15 years agoMFC: Use kvm_getcptime() to fetch the equivalent of the kern.cp_time sysctl
jhb [Fri, 12 Sep 2008 21:50:42 +0000 (21:50 +0000)]
MFC: Use kvm_getcptime() to fetch the equivalent of the kern.cp_time sysctl
from a crash dump.

Approved by: re (kib)

15 years agoMFC: Fail detach if cpufreq_unregister() fails.
jhb [Fri, 12 Sep 2008 21:46:23 +0000 (21:46 +0000)]
MFC: Fail detach if cpufreq_unregister() fails.

Approved by: re (kensmith)

15 years agoMFC: Remove the never-enabled attempt at using device cloning to provide
jhb [Fri, 12 Sep 2008 21:44:31 +0000 (21:44 +0000)]
MFC: Remove the never-enabled attempt at using device cloning to provide
per-file descriptor storage and replace it with cdevpriv (and enable it)
instead.

Approved by: re (kib)

15 years agoMFC: Adjust the handling of the various timer frequencies when using the
jhb [Fri, 12 Sep 2008 21:40:57 +0000 (21:40 +0000)]
MFC: Adjust the handling of the various timer frequencies when using the
lapic timer to use dynamic divisors and try to keep stathz around 128.

Approved by: re (kib)

15 years agoMFC: Fix two places that used && instead of & to test if OBF was set.
jhb [Fri, 12 Sep 2008 21:36:48 +0000 (21:36 +0000)]
MFC: Fix two places that used && instead of & to test if OBF was set.

Approved by: re (kib)

15 years agoMFC: Add a script to perform simple analysis of a crash dump.
jhb [Fri, 12 Sep 2008 21:30:54 +0000 (21:30 +0000)]
MFC: Add a script to perform simple analysis of a crash dump.

Approved by: re (kib)

15 years agoMFC: Only count the number of CPUs in the rendezvous map once, use
jhb [Fri, 12 Sep 2008 21:07:22 +0000 (21:07 +0000)]
MFC: Only count the number of CPUs in the rendezvous map once, use
CPU_ABSENT(), and count up to mp_maxid.

Approved by: re (kib)

15 years agoMFC: Fix a spin lock LOR when waking up a thread from a process that is
jhb [Fri, 12 Sep 2008 21:00:11 +0000 (21:00 +0000)]
MFC: Fix a spin lock LOR when waking up a thread from a process that is
swapped out by deferring the wakeup of the swapper kernel process until
after releasing sleepq chain locks.

Approved by: re (kib)

15 years agoMFC r182739: license change from NetBSD.
delphij [Fri, 12 Sep 2008 20:35:17 +0000 (20:35 +0000)]
MFC r182739: license change from NetBSD.

Approved by: re (kib)

15 years agoMFC: Don't disable USB in the PAE kernel config.
jhb [Fri, 12 Sep 2008 20:09:05 +0000 (20:09 +0000)]
MFC: Don't disable USB in the PAE kernel config.

Approved by: re (kib)

15 years agoMFC: svn r182885, cvs rev. 1.381 tcp_input.c
bz [Fri, 12 Sep 2008 19:28:57 +0000 (19:28 +0000)]
MFC: svn r182885, cvs rev. 1.381 tcp_input.c

  Work around an integer division resulting in 0 and thus the
  congestion window not being incremented, if cwnd > maxseg^2.
  As suggested in RFC2581 increment the cwnd by 1 in this case.

  See http://caia.swin.edu.au/reports/080829A/CAIA-TR-080829A.pdf
  for more details.

Submitted by: Alana Huebner, Lawrence Stewart,
Grenville Armitage (caia.swin.edu.au)
Reviewed by: dwmalone, gnn, rpaulo, silby
Approved by: re (gnn)

15 years agoMFC r182854
remko [Fri, 12 Sep 2008 18:37:52 +0000 (18:37 +0000)]
MFC r182854

  Fix deactivation of speakers while plugging in headphones on Fujitsu
  U1010, Lenovo 3k N200 and Acer Aspire 4715Z.

  Reviewed by:    attilio
  PR:             126216, 126244, 127034
  Submitted by:   Anton E. Kartashev <amokk@mirahost.ru>,
                  Ganael Laplanche <ganael.laplanche@martymac.com>,
                  Dennis Generaloff <giantlock@gmail.com>

Requested by: joel
Approved by: re (kib, via joel), imp (mentor, implicit)
Obtained from: joel

15 years agoMFC r182722:
rpaulo [Fri, 12 Sep 2008 18:26:09 +0000 (18:26 +0000)]
MFC r182722:
   Fix the sysctl function parameters. We were only querying Sensor 0.
   Noticed by:     des

Approved by: re

15 years agoMFC r182816:
kib [Fri, 12 Sep 2008 13:08:12 +0000 (13:08 +0000)]
MFC r182816:
Document BUS_DMA_NOCACHE.

MFC r182962:
Remove unneeded comma.

Approved by: re (kensmith)

15 years agoMFC r182838: Correct tar -xP so that it will follow symlinks to
kientzle [Fri, 12 Sep 2008 04:34:56 +0000 (04:34 +0000)]
MFC r182838: Correct tar -xP so that it will follow symlinks to
existing dirs.

Approved by: re (Kostik Belousov)

15 years agoMFC 182899
kmacy [Thu, 11 Sep 2008 23:58:46 +0000 (23:58 +0000)]
MFC 182899

  - Fix regression with GETMEM
  - Remove gratuitous bswap macros
  - check for rev 3 with t3b

Approved by: re
Obtained from: Chelsio Inc.

15 years agoMFC 181614
kmacy [Thu, 11 Sep 2008 23:53:08 +0000 (23:53 +0000)]
MFC 181614

Vendor fix for PHY problem.

Approved by: re
Obtained from: Chelsio Inc

15 years agoMFC 182591
kmacy [Thu, 11 Sep 2008 23:49:36 +0000 (23:49 +0000)]
MFC 182591

Don't check if an interface can do tcp offload if there are no offload devices registered on the system.

Approved by: re

15 years agoMFC: Use single byte read and write operations to toggle the BIOS and OS
jhb [Thu, 11 Sep 2008 19:36:03 +0000 (19:36 +0000)]
MFC: Use single byte read and write operations to toggle the BIOS and OS
semaphores rather than 4 byte operations.

Approved by: re (kensmith)

15 years agoMFC: Several changes (181759-181762) to allow the "simple" and "client"
jhb [Thu, 11 Sep 2008 19:08:51 +0000 (19:08 +0000)]
MFC: Several changes (181759-181762) to allow the "simple" and "client"
firewall configurations to be configured (interfaces and attached networks)
from rc.conf rather than requiring users to edit /etc/rc.firewall directly.

Approved by: re (kensmith)

15 years agoMFC: Use default CPU compiler flags that work on all amd64-capable CPUs
jhb [Thu, 11 Sep 2008 18:59:53 +0000 (18:59 +0000)]
MFC: Use default CPU compiler flags that work on all amd64-capable CPUs
when building 32-bit compat libs.

Approved by: re (kensmith)

15 years agoMFC: r182594, r182679, r182694, r182899
kmacy [Thu, 11 Sep 2008 04:21:05 +0000 (04:21 +0000)]
MFC:  r182594, r182679, r182694, r182899

Bring cxgbtool and corresponding ioctl interfaces up to version 1.5

Approved by: re
Obtained from: Chelsio Inc.

15 years agoMFC 182882:
kmacy [Wed, 10 Sep 2008 23:41:49 +0000 (23:41 +0000)]
MFC 182882:

Fix issue with recovering from transient jumbo mbuf shortage.

Submitted by: Chelsio Inc
Approved by: re

15 years agoMFC 182089:
kmacy [Wed, 10 Sep 2008 23:37:06 +0000 (23:37 +0000)]
MFC 182089:
Don't calculate checksum if it has already been validated
lro_opt.diff

Approved by: re
Obtained from: Chelsio Inc.

15 years agoMFC: Use ppc_detach() for device_detach instead of ppc_attach().
jhb [Wed, 10 Sep 2008 22:46:02 +0000 (22:46 +0000)]
MFC: Use ppc_detach() for device_detach instead of ppc_attach().

Approved by: re (kensmith)

15 years agoMFC: Add more PCI IDs including those for ICH10.
jhb [Wed, 10 Sep 2008 21:53:15 +0000 (21:53 +0000)]
MFC: Add more PCI IDs including those for ICH10.

Approved by: re (kensmith)

15 years agoRevert r180140 for 6.4 and 7.1 where the bridge mac address is taken from the
thompsa [Mon, 8 Sep 2008 03:18:00 +0000 (03:18 +0000)]
Revert r180140 for 6.4 and 7.1 where the bridge mac address is taken from the
first member, there were problems reported in edge cases and using pppoe.

Reviewed by: philip
Approved by: re (kensmith)

15 years agoMFC r182587: If atime is missing, use time at which program started
kientzle [Sat, 6 Sep 2008 06:01:45 +0000 (06:01 +0000)]
MFC r182587: If atime is missing, use time at which program started
instead of substituting mtime

Approved by: re (Ken Smith)

15 years agoMFC r180507: enhance volume handling.
flz [Fri, 5 Sep 2008 14:08:26 +0000 (14:08 +0000)]
MFC r180507: enhance volume handling.

PR: bin/125054
Submitted by: gahr
Approved by: re (gnn)

15 years agoMFC: r182380
jkim [Thu, 4 Sep 2008 15:18:32 +0000 (15:18 +0000)]
MFC:    r182380

Validate scratch memory addresses for BPF_STX and BPF_LDX|BPF_MEM.
A badly written filter was able to reference invalid addresses,
even cause kernel crash.

Approved by: re (kensmith)

15 years agoMFC: Sync. BPF JIT compiler with HEAD.
jkim [Thu, 4 Sep 2008 15:15:39 +0000 (15:15 +0000)]
MFC: Sync. BPF JIT compiler with HEAD.

- r182172:
Embed scratch memory in the filter structure.

- r182173:
Fix a typo in copyrights.

- r182220:
Move empty filter handling to MI source.

- r182376:
Initialize scratch memory for JIT-compiled filter when it is allocated.
Previously it may have contained unnecessary (even sensitive) data from
the previous allocation.
As a (good) side effect, scratch memory may be used to store the previous
filter state(s) safely because it is allocated and freed with filter itself.
However, use it carefully because bpf_filter(9) does not have this behavior.

Approved by: re (kensmith)

15 years agoMFC r182670, which fixes a multiple locking bug that would panic WITNESS-enabled...
nwhitehorn [Thu, 4 Sep 2008 14:37:53 +0000 (14:37 +0000)]
MFC r182670, which fixes a multiple locking bug that would panic WITNESS-enabled kernels.

Approved by: re, marcel (mentor)

15 years agoMFC r182600:
kib [Thu, 4 Sep 2008 14:25:10 +0000 (14:25 +0000)]
MFC r182600:
In rev. 1.17 (r33548) of msdosfs_fat.c, relative cluster numbers were
replaced by file relative sector numbers as the buffer block number
when zero-padding a file during extension. Revert the change, it causes
wrong blocks filled with zeroes on seeking beyond end of file.

PR: kern/47628
Approved by: re (kensmith)