]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years agoAdd support for using a livefs from a USB disk.
cperciva [Wed, 8 Jul 2009 06:07:51 +0000 (06:07 +0000)]
Add support for using a livefs from a USB disk.

Submitted by: randi
Approved by: re (kensmith)

15 years agoRefactor code from installFixitCDROM into a new function, fixit_livefs_common.
cperciva [Wed, 8 Jul 2009 06:07:23 +0000 (06:07 +0000)]
Refactor code from installFixitCDROM into a new function, fixit_livefs_common.
While doing so, improve style and reword some comments.

This should not result in any functional changes, but the fixit_livefs_common
function will be used by future code.

Submitted by: randi
Approved by: re (kensmith)

15 years agoFix kernel panic, when ataahci driver is used on system with increased
mav [Wed, 8 Jul 2009 06:00:21 +0000 (06:00 +0000)]
Fix kernel panic, when ataahci driver is used on system with increased
MAXPHYS. Current ataahci driver memory allocation scheme includes only
64 items in DMA S/G table, and so not guarantied to support transactions
with more then 252K data.

Approved by:    re (kensmith)
MFC after:      2 weeks

15 years agoRevert revisions 188839 and 188868. Use of the ioctl in geom_dev.c
marcel [Wed, 8 Jul 2009 05:56:14 +0000 (05:56 +0000)]
Revert revisions 188839 and 188868. Use of the ioctl in geom_dev.c
is invalid because the ioctl happens without prior open. The ioctl
got introduced to provide backward compatibility for extended
partitions, but it ended up not being used because it didn't work
as expected. Since there are no consumers of the ioctl and the
implementation is broken, the best fix is to remove the code
entirely.

Spotted by: phk
Approved by: re (kensmith)

15 years agoIncrease HZ_VM from 10 to 100. While 10 hz saves cpu time
silby [Wed, 8 Jul 2009 01:09:12 +0000 (01:09 +0000)]
Increase HZ_VM from 10 to 100.  While 10 hz saves cpu time
under VM environments, it's too slow for FreeBSD to work
properly.  For example, ping at 10hz pings about every 600ms
instead of about every second.

Approved by: re (kib)

15 years agoFix ar5416 and later parts on big-endian platforms: setup the h/w byte
sam [Tue, 7 Jul 2009 18:11:05 +0000 (18:11 +0000)]
Fix ar5416 and later parts on big-endian platforms: setup the h/w byte
swizzler using the same technique used everywhere else.

Approved by: re (kib)

15 years agoFix two typos and sort sysctls.
joel [Tue, 7 Jul 2009 13:58:47 +0000 (13:58 +0000)]
Fix two typos and sort sysctls.

PR: docs/136408
Approved by: re (blanket)

15 years agoFix poll(2) and select(2) for named pipes to return "ready for read"
kib [Tue, 7 Jul 2009 09:43:44 +0000 (09:43 +0000)]
Fix poll(2) and select(2) for named pipes to return "ready for read"
when all writers, observed by reader, exited. Use writer generation
counter for fifo, and store the snapshot of the fifo generation in the
f_seqcount field of struct file, that is otherwise unused for fifos.
Set FreeBSD-undocumented POLLINIGNEOF flag only when file f_seqcount is
equal to fifo' fi_wgen, and revert r89376.

Fix POLLINIGNEOF for sockets and pipes, and return POLLHUP for them.
Note that the patch does not fix not returning POLLHUP for fifos.

PR: kern/94772
Submitted by: bde (original version)
Reviewed by: rwatson, jilles
Approved by: re (kensmith)
MFC after: 6 weeks (might be)

15 years agoBump for BETA1.
kensmith [Tue, 7 Jul 2009 00:02:26 +0000 (00:02 +0000)]
Bump for BETA1.

Approved by: re (implicit)

15 years agoFix AR5416 and later parts when building with AH_DEBUG or similar defined:
sam [Mon, 6 Jul 2009 20:51:54 +0000 (20:51 +0000)]
Fix AR5416 and later parts when building with AH_DEBUG or similar defined:
always define OS_REG_UNSWAPPED and use it in ath_hal_reg_{read,write}.

Approved by: re (kib)

15 years agoDocument the new EQ and VPC features along with a few loader tunables.
joel [Mon, 6 Jul 2009 19:32:13 +0000 (19:32 +0000)]
Document the new EQ and VPC features along with a few loader tunables.

Reviewed by: ariff
Approved by: re (blanket)

15 years agoWhen pmap_change_attr() changes the PAT setting on a kernel mapping, it has
alc [Mon, 6 Jul 2009 18:43:42 +0000 (18:43 +0000)]
When pmap_change_attr() changes the PAT setting on a kernel mapping, it has
to simultaneously change the PAT setting for the same pages within the
direct map region.  This may require the demotion of a 2MB page mapping and
the allocation of a page table page.  This revision gives the highest
possible priority (VM_ALLOC_INTERRUPT) to this page allocation, so that
pmap_change_attr() is less likely to fail.  (In general, kernel page table
page allocations have the highest priority, so this is not creating a new
precedent.)

(Demotion of 1GB page mappings within the direct map already specifies
VM_ALLOC_INTERRUPT to vm_page_alloc(), so only pmap_demote_pde() must be
changed.)

Approved by: re (kib)

15 years agoAfter the per-CPU IDT changes, the IDT vector of an interrupt could change
jhb [Mon, 6 Jul 2009 18:23:00 +0000 (18:23 +0000)]
After the per-CPU IDT changes, the IDT vector of an interrupt could change
when the interrupt was moved from one CPU to another.  If the interrupt was
enabled, then the old IDT vector needs to be disabled and the new IDT vector
needs to be enabled.  This was mostly masked prior to the recent MSI changes
since in the older code almost all allocated IDT vectors were already enabled
and the enabled vectors on the BSP during boot covered enough of the IDT
range.  However, after the MSI changes, MSI interrupts that were allocated
but not enabled (e.g. DRM with MSI) during boot could result in an allocated
IDT vector that wasn't enabled.  The round-robin at the end of boot could
place another interrupt at the same IDT vector without enabling the IDT
vector causing trap 30 faults.

Fix this by explicitly disabling/enabling the old and new IDT vectors for
enabled interrupt sources when moving an interrupt between CPUs via the
pic_assign_cpu() method.  While here, fix a bug in my earlier changes so
that an I/O APIC interrupt pin is left unchanged if ioapic_assign_cpu()
fails to allocate a new IDT vector and returns ENOSPC.

Approved by: re (kensmith)

15 years agoMFi386: Add a 'show idt' command to DDB to display the non-default function
jhb [Mon, 6 Jul 2009 18:10:27 +0000 (18:10 +0000)]
MFi386: Add a 'show idt' command to DDB to display the non-default function
pointers in the interrupt descriptor table.

Approved by: re (kensmith)

15 years agoThe new method of reading the mac address from the
jfv [Mon, 6 Jul 2009 17:23:48 +0000 (17:23 +0000)]
The new method of reading the mac address from the
RAR(0) register does not work on this old adapter,
provide a local routine that does it the older way.

Approved by:  re

15 years ago- pkg_install is maintained by portmgr.
flz [Mon, 6 Jul 2009 11:46:18 +0000 (11:46 +0000)]
- pkg_install is maintained by portmgr.
- BSD.x11{,-4}.dist aren't used anymore and BSD.local.dist now lives
in ports/Templates/. Most people apparently missed that move and still
commit to the src copy, so I'll have to remove it eventually but for
now, the MAINTAINERS line can go.

Approved by: re (kib)

15 years agoIn the current code, rdlock_count is not correctly handled for some cases.
attilio [Mon, 6 Jul 2009 09:31:04 +0000 (09:31 +0000)]
In the current code, rdlock_count is not correctly handled for some cases.
The most notable is that it is not bumped in rwlock_rdlock_common() when
the hard path (__thr_rwlock_rdlock()) returns successfully.
This can lead to deadlocks in libthr when rwlocks recursion in read mode
happens.
Fix the interested parts by correctly handling rdlock_count.

PR: threads/136345
Reported by: rink
Tested by: rink
Reviewed by: jeff
Approved by: re (kib)
MFC: 2 weeks

15 years agoThis addresses some issues with my earlier -R fix that
kientzle [Mon, 6 Jul 2009 02:02:45 +0000 (02:02 +0000)]
This addresses some issues with my earlier -R fix that
were pointed out by Brooks Davis and Alexey Dokuchaev:
* It now tries to lookup arguments as names first, then tries
   to parse them as numbers.  In particular, this makes the
   behavior consistent with POSIX conventions when usernames
   consist entirely of digits.
* It now uses strtoul() for the numeric parsing.

Finally, I've included an update to the test harness
to exercise the new numeric cases for -R.

Approved by: re (kib)

15 years agoPAE adds another level to the i386 page table. This level is a small
alc [Sun, 5 Jul 2009 21:40:21 +0000 (21:40 +0000)]
PAE adds another level to the i386 page table.  This level is a small
4-entry table that must be located within the first 4GB of RAM.  This
requirement is met by defining an UMA zone with a custom back-end
allocator function.  This revision makes two changes to this back-end
allocator function: (1) It replaces the use of contigmalloc() with the
use of kmem_alloc_contig().  This eliminates "double accounting", i.e.,
accounting by both the UMA zone and malloc tags.  (I made the same
change for the same reason to the zones supporting jumbo frames a week
ago.) (2) It passes through the "wait" parameter, i.e., M_WAITOK,
M_ZERO, etc. to kmem_alloc_contig() rather than ignoring it.
pmap_init() calls uma_zalloc() with both M_WAITOK and M_ZERO.  At the
moment, this is harmless only because the default behavior of
contigmalloc()/kmem_alloc_contig() is to wait and because pmap_init()
doesn't really depend on the memory being zeroed.

The back-end allocator function in the Xen pmap is dead code.  I am
changing it nonetheless because I don't want to leave any "bad examples"
in the source tree for someone to copy at a later date.

Approved by: re (kib)

15 years agocatchup with action+ageq additions
sam [Sun, 5 Jul 2009 21:19:10 +0000 (21:19 +0000)]
catchup with action+ageq additions

Submitted by: "Paul B. Mahol" <onemda@gmail.com>
Approved by: re (implicit)

15 years agoadd missing bit of r195379
sam [Sun, 5 Jul 2009 20:44:50 +0000 (20:44 +0000)]
add missing bit of r195379

Approved by: re (kensmith)

15 years ago- Don't suggest opening file for writing in preparation for fexecve(2).
pjd [Sun, 5 Jul 2009 20:20:09 +0000 (20:20 +0000)]
- Don't suggest opening file for writing in preparation for fexecve(2).
- execve(2)/fexecve(2) won't return ETXTBSY if file is open for reading.

Approved by: re (kib)

15 years agoAdd ieee80211_ageq; a facility for staging packets that require
sam [Sun, 5 Jul 2009 18:17:37 +0000 (18:17 +0000)]
Add ieee80211_ageq; a facility for staging packets that require
long-term work before they can be serviced.  Packets are tagged and
assigned an age (in seconds) at the point they are added to the
queue.  If a packet is not retrieved before it's age expires it is
reclaimed.  Tagging can take two forms: a reference to an ieee80211_node
(as happens in the tx path) or an opaque token in cases where there
is no reference or the node structure is not stable (i.e. it's going
to be destroyed).

o add ic_stageq to replace the per-node wds staging queue used for
  dynamic wds
o add ieee80211_mac_hash for building ageq tokens; this computes a
  32-bit hash from an 802.11 mac address (copied from the bridge)
o while here fix a stray ';' noticed in IEEE80211_PSQ_INIT

Reviewed by: rpaulo
Approved by: re (kensmith)

15 years ago- Increase dynamic range of filter coefficients from 28bit to 30bit.
ariff [Sun, 5 Jul 2009 18:15:06 +0000 (18:15 +0000)]
- Increase dynamic range of filter coefficients from 28bit to 30bit.
  This cause dramatic effect in overall precision and conversion quality
  by pushing down most aliasing artifacts around -180 dB.

  Spectrogram analysis/comparison:

   http://people.freebsd.org/~ariff/z_comparison/z_28vs30/

- Guard against possible 64bit overflow during accumulation process by
  slightly normalize and saturate sample and coefficient multiplication,
  possible during extreme 32bit downsampling (eg. 380KHz -> 8KHz) with
  custom preset that require more than ~7000 taps filter (which is
  overkill).

- Add knobs through FEEDER_RATE_PRESETS to set dynamic range of filter
  coefficients/accumulator and prefered polynomial interpolator:

   COEFFICIENT_BIT:X
(where 1 <= X <= 30, default: 30)

ACCUMULATOR_BIT:X
(where 32 <= X <=64, default: 58)

INTERPOLATOR:I
(where I = ZOH, LINEAR, QUADRATIC, HERMITE, BSPLINE,
             OPT32X, OPT16X, OPT8X, OPT4X, OPT2X)

Approved by: re (kib)

15 years agoRevamp 802.11 action frame handling:
sam [Sun, 5 Jul 2009 17:59:19 +0000 (17:59 +0000)]
Revamp 802.11 action frame handling:
o add a new facility for components to register send+recv handlers
o ieee80211_send_action and ieee80211_recv_action now use the registered
  handlers to dispatch operations
o rev ieee80211_send_action api to enable passing arbitrary data
o rev ieee80211_recv_action api to pass the 802.11 frame header as it may
  be difficult to locate
o update existing IEEE80211_ACTION_CAT_BA and IEEE80211_ACTION_CAT_HT handling
o update mwl for api rev

Reviewed by: rpaulo
Approved by: re (kensmith)

15 years agoCleanup ALIGNED_POINTER:
sam [Sun, 5 Jul 2009 17:45:48 +0000 (17:45 +0000)]
Cleanup ALIGNED_POINTER:
o add to platforms where it was missing (arm, i386, powerpc, sparc64, sun4v)
o define as "1" on amd64 and i386 where there is no restriction
o make the type returned consistent with ALIGN
o remove _ALIGNED_POINTER
o make associated comments consistent

Reviewed by: bde, imp, marcel
Approved by: re (kensmith)

15 years agoAdd a missing phrase.
brian [Sun, 5 Jul 2009 16:55:57 +0000 (16:55 +0000)]
Add a missing phrase.

Submitted by: Jason McIntyre jmc at kerhand dot co dot uk
Approved by: re (kib)
Obtained from: OpenBSD
MFC after: 3 weeks

15 years agoWhen the kernel is configured without "options FFS", build UFS as a module
trasz [Sun, 5 Jul 2009 15:25:02 +0000 (15:25 +0000)]
When the kernel is configured without "options FFS", build UFS as a module
without requiring any special build flags.

Approved by: re (kib)

15 years agoMark atanvidia depending on ataahci since rev.188846.
mav [Sun, 5 Jul 2009 14:50:45 +0000 (14:50 +0000)]
Mark atanvidia depending on ataahci since rev.188846.

Approved by: re (kib)

15 years agoAdd missing reference to GPT support.
ivoras [Sun, 5 Jul 2009 14:03:41 +0000 (14:03 +0000)]
Add missing reference to GPT support.

Submitted by: Paul B. Mahol onemda at gmail.com
Approved by: re (kib)

15 years agoDisable r194497 for now. It doesn't work well with ports-mgmt/tinderbox.
brian [Sun, 5 Jul 2009 06:14:59 +0000 (06:14 +0000)]
Disable r194497 for now.  It doesn't work well with ports-mgmt/tinderbox.

Approved by: re (ken)

15 years agoAdd a new options (-s) that, when specified, skips the question about
attilio [Sat, 4 Jul 2009 11:11:21 +0000 (11:11 +0000)]
Add a new options (-s) that, when specified, skips the question about
adjusting the clock to UTC.
That avoids to write on /etc/wall_cmos_clock which is useful in some
cases (example: host user in a jail).

Sponsored by: Sandvine Incorporated
Initially submitted by: Matt Koivisto <mkoivisto at sandvine dot com>
Approved by: re (kib)

15 years agoWhen forking a vm space that has wired map entries, do not forget to
kib [Fri, 3 Jul 2009 22:17:37 +0000 (22:17 +0000)]
When forking a vm space that has wired map entries, do not forget to
charge the objects created by vm_fault_copy_entry. The object charge
was set, but reserve not incremented.

Reported by: Greg Rivers <gcr+freebsd-current tharned org>
Reviewed by: alc (previous version)
Approved by: re (kensmith)

15 years agoacpi_hp.c:
rpaulo [Fri, 3 Jul 2009 21:12:37 +0000 (21:12 +0000)]
acpi_hp.c:
- sysctl dev.acpi_hp.0.verbose to toggle debug output
- A modification so this can deal with different array lengths
  when reading the CMI BIOS - now it works ok on HP Compaq nx7300
  as well.
- Change behaviour to query only max_instance-1 CMI BIOS instances,
  because all HPs seen so far are broken in that respect
  (or there is a fundamental misunderstanding on my side, possible
  as well). This way a disturbing ACPI Error Field exceeds Buffer
  message is avoided.
- New bit to set on dev.acpi_hp.0.cmi_detail (0x8) to
  also query the highest guid instance of CMI bios

acpi_hp.4:
- Document dev.acpi_hp.0.verbose sysctl in man page
- Document new bit for dev.acpi_hp.0.cmi_detail
- Add a section to manpage about hardware that has been reported
  to work ok

Submitted by: Michael Gmelin <freebsdusb at bindone.de>
Approved by: re (kib)
MFC after: 2 weeks

15 years agoThis fixes bsdcpio's -R option to accept numeric
kientzle [Fri, 3 Jul 2009 17:54:33 +0000 (17:54 +0000)]
This fixes bsdcpio's -R option to accept numeric
user or group Ids as well as user or group names.
In particular, this fixes freesbie2, which uses
-R 0:0 to copy a bunch of files so that the result
will be owned by root.

Also fixes a related bug that mixed-up the uid
and gid specified by -R when in passthrough mode.

Thanks to Dominique Goncalves for reporting this
regression.

Approved by: re (kib)

15 years agoFix fpathconf(3) on fifos, in effect making ls(1) properly
trasz [Thu, 2 Jul 2009 20:05:21 +0000 (20:05 +0000)]
Fix fpathconf(3) on fifos, in effect making ls(1) properly
display '+' on them.  Taken from kern/125613, with cosmetic
changes.

PR: kern/125613
Submitted by: Jaakko Heinonen <jh at saunalahti dot fi>
Approved by: re (kib)

15 years agoEnable POSIX semaphores on all non-embedded architectures by default.
ed [Thu, 2 Jul 2009 18:24:37 +0000 (18:24 +0000)]
Enable POSIX semaphores on all non-embedded architectures by default.

More applications (including Firefox) seem to depend on this nowadays,
so not having this enabled by default is a bad idea.

Proposed by: miwi
Patch by: Florian Smeets <flo kasimir com>
Approved by: re (kib)

15 years agoIn vn_vget_ino() and their inline equivalents, mnt_ref() the mount point
kib [Thu, 2 Jul 2009 18:02:55 +0000 (18:02 +0000)]
In vn_vget_ino() and their inline equivalents, mnt_ref() the mount point
around the sequence that drop vnode lock and then busies the mount point.
Not having vlocked node or direct reference to the mp allows for the
forced unmount to proceed, making mp unmounted or reused.

Tested by: pho
Reviewed by: jeff
Approved by: re (kensmith)
MFC after: 2 weeks

15 years agoCreate audit records for AUE_POSIX_OPENPT, currently w/o arguments.
rwatson [Thu, 2 Jul 2009 16:33:38 +0000 (16:33 +0000)]
Create audit records for AUE_POSIX_OPENPT, currently w/o arguments.

Approved by: re (audit argument blanket)

15 years agoCall prison_check from vfs_suser rather than re-implementing it.
jamie [Thu, 2 Jul 2009 14:19:33 +0000 (14:19 +0000)]
Call prison_check from vfs_suser rather than re-implementing it.

Approved by: re (kib), bz (mentor)

15 years agoSlightly increase amount of bandwidth of resampling filter for
ariff [Thu, 2 Jul 2009 10:02:10 +0000 (10:02 +0000)]
Slightly increase amount of bandwidth of resampling filter for
feeder_rate_quality=3. This have the benefit of reducing aliasing
artifacts due to alias masking.

Spectrogram analysis:

 o Old preset (100:36:0.90)
http://people.freebsd.org/~ariff/z_comparison/z_q3_old.png

 o New preset (100:36:0.92):
http://people.freebsd.org/~ariff/z_comparison/z_q3_new.png

Approved by: re (kib)

15 years agoFix comment misthink.
rwatson [Thu, 2 Jul 2009 09:50:13 +0000 (09:50 +0000)]
Fix comment misthink.

Submitted by: b. f. <bf1783 at googlemail.com>
Approved by: re (audit argument blanket)
MFC after: 1 week

15 years agoAudit file descriptor and command arguments to ioctl(2).
rwatson [Thu, 2 Jul 2009 09:16:25 +0000 (09:16 +0000)]
Audit file descriptor and command arguments to ioctl(2).

Approved by: re (audit argument blanket)
MFC after: 1 week

15 years agoClean up a number of aspects of token generation from audit arguments to
rwatson [Thu, 2 Jul 2009 09:15:30 +0000 (09:15 +0000)]
Clean up a number of aspects of token generation from audit arguments to
system calls:

- Centralize generation of argument tokens for VM addresses in a macro,
  ADDR_TOKEN(), and properly encode 64-bit addresses in 64-bit arguments.
- Fix up argument numbers across a large number of syscalls so that they
  match the numeric argument into the system call.
- Don't audit the address argument to ioctl(2) or ptrace(2), but do keep
  generating tokens for mmap(2), minherit(2), since they relate to passing
  object access across execve(2).

Approved by: re (audit argument blanket)
Obtained from: TrustedBSD Project
MFC after: 1 week

15 years agoUse MPT_MAX_LUNS as maximium number of LUNs, not 7, for SAS and FC cases.
delphij [Thu, 2 Jul 2009 00:43:10 +0000 (00:43 +0000)]
Use MPT_MAX_LUNS as maximium number of LUNs, not 7, for SAS and FC cases.
This matches Linux driver behavior.

Discussed with: scottl
Approved by: re (kensmith)
MFC after: 1 month

15 years agoChange explicit maximium numbers to the defined macro MPT_MAX_LUNS.
delphij [Thu, 2 Jul 2009 00:41:37 +0000 (00:41 +0000)]
Change explicit maximium numbers to the defined macro MPT_MAX_LUNS.

Approved by: re (kensmith)

15 years agoFor access(2) and eaccess(2), audit the requested access mode.
rwatson [Wed, 1 Jul 2009 22:47:45 +0000 (22:47 +0000)]
For access(2) and eaccess(2), audit the requested access mode.

Approved by: re (audit argument blanket)
MFC after: 3 days

15 years agoDon't panic on attempt to set ACL on a block device file.
trasz [Wed, 1 Jul 2009 22:30:36 +0000 (22:30 +0000)]
Don't panic on attempt to set ACL on a block device file.
This is just a part of kern/125613.

PR: kern/125613
Submitted by: Jaakko Heinonen <jh at saunalahti dot fi>
Reviewed by: rwatson
Approved by: re (kib)

15 years ago- Properly order headers, local variables and prototypes. [1]
stas [Wed, 1 Jul 2009 22:23:26 +0000 (22:23 +0000)]
- Properly order headers, local variables and prototypes. [1]
- Remove unneeded headers.
- Return non-zero error code in usage().

Approved by: re (kib)
Suggested by: bde [1]

15 years ago - Use fd_lastfile + 1 as the upper bound on nd. This is more correct than
jeff [Wed, 1 Jul 2009 20:43:46 +0000 (20:43 +0000)]
 - Use fd_lastfile + 1 as the upper bound on nd.  This is more correct than
   using the size of the descriptor array.
 - A lock is not needed to fetch fd_lastfile.  The results are stale the
   instant it is dropped.
 - Use a private mutex pool for select since the pool mutex is not used
   as a leaf.
 - Fetch the si_mtx pointer first before resorting to hashing to compute
   the mutex address.

Reviewed by: McKusick
Approved by: re (kib)

15 years agoFix a panic which (reportedly) can happen when unmounting a filesystem
trasz [Wed, 1 Jul 2009 20:16:29 +0000 (20:16 +0000)]
Fix a panic which (reportedly) can happen when unmounting a filesystem
with I/O requests in flight on kernels compiled with "options INVARIANTS".
Also, make it obvious it's not right to call g_valid_obj() (and macros
using it, e.g. G_VALID_CONSUMER()) without topology lock held.

Approved by: re (kib)
Reported by: pho

15 years agoMap DPCPU pages into ARM kernel VA space.
raj [Wed, 1 Jul 2009 20:07:44 +0000 (20:07 +0000)]
Map DPCPU pages into ARM kernel VA space.

DPCPU area was not properly mapped into kernel VA space, which caused page
fault on the first DPCPU access. This patch fixes the problem by mapping DPCPU
area into kernel VA space.

Submitted by: Michal Hajduk, Piotr Ziecik
Reviewed by: cognet, stas
Approved by: re (kib)
Obtained from: Semihalf

15 years agoAudit file descriptor numbers for various socket-related system calls.
rwatson [Wed, 1 Jul 2009 19:55:11 +0000 (19:55 +0000)]
Audit file descriptor numbers for various socket-related system calls.

Approved by: re (audit argument blanket)
MFC after: 3 days

15 years agoDefine missing audit argument macro AUDIT_ARG_SOCKET(), and
rwatson [Wed, 1 Jul 2009 18:54:49 +0000 (18:54 +0000)]
Define missing audit argument macro AUDIT_ARG_SOCKET(), and
capture the domain, type, and protocol arguments to socket(2)
and socketpair(2).

Approved by: re (audit argument blanket)
MFC after: 3 days

15 years agoClarify the node about removing NFS_LEGACYRPC
dfr [Wed, 1 Jul 2009 18:12:50 +0000 (18:12 +0000)]
Clarify the node about removing NFS_LEGACYRPC

Approved by: re

15 years agoImprove the handling of cpuset with interrupts.
jhb [Wed, 1 Jul 2009 17:20:07 +0000 (17:20 +0000)]
Improve the handling of cpuset with interrupts.
- For x86, change the interrupt source method to assign an interrupt source
  to a specific CPU to return an error value instead of void, thus allowing
  it to fail.
- If moving an interrupt to a CPU fails due to a lack of IDT vectors in the
  destination CPU, fail the request with ENOSPC rather than panicing.
- For MSI interrupts on x86 (but not MSI-X), only allow cpuset to be used
  on the first interrupt in a group.  Moving the first interrupt in a group
  moves the entire group.
- Use the icu_lock to protect intr_next_cpu() on x86 instead of the
  intr_table_lock to fix a LOR introduced in the last set of MSI changes.
- Add a new privilege PRIV_SCHED_CPUSET_INTR for using cpuset with
  interrupts.  Previously, binding an interrupt to a CPU only performed a
  privilege check if the interrupt had an interrupt thread.  Interrupts
  without a thread could be bound by non-root users as a result.
- If an interrupt event's assign_cpu method fails, then restore the original
  cpuset mask for the associated interrupt thread.

Approved by: re (kib)

15 years agoWhen auditing unmount(2), capture FSID arguments as regular text strings
rwatson [Wed, 1 Jul 2009 16:56:56 +0000 (16:56 +0000)]
When auditing unmount(2), capture FSID arguments as regular text strings
rather than as paths, which would lead to them being treated as relative
pathnames and hence confusingly converted into absolute pathnames.

Capture flags to unmount(2) via an argument token.

Approved by: re (audit argument blanket)
MFC after: 3 days

15 years agoWhen unmounting an NFS mount using sec=krb5[ip], the umount system
rmacklem [Wed, 1 Jul 2009 16:42:03 +0000 (16:42 +0000)]
When unmounting an NFS mount using sec=krb5[ip], the umount system
call could get hung sleeping on "gsssta" if the credentials for a user
that had been accessing the mount point have expired. This happened
because rpc_gss_destroy_context() would end up calling itself when the
"destroy context" RPC was attempted, trying to refresh the credentials.
This patch just checks for this case in rpc_gss_refresh() and returns
without attempting the refresh, which avoids the recursive call to
rpc_gss_destroy_context() and the subsequent hang.

Reviewed by: dfr
Approved by: re (Ken Smith), kib (mentor)

15 years agoMake sure that cr_error is set to ESHUTDOWN when closing the connection.
rmacklem [Wed, 1 Jul 2009 16:38:18 +0000 (16:38 +0000)]
Make sure that cr_error is set to ESHUTDOWN when closing the connection.
This is normally done by a loop in clnt_dg_close(), but requests that aren't
in the pending queue at the time of closing, don't get set. This avoids a
panic in xdrmbuf_create() when it is called with a NULL cr_mrep if
cr_error doesn't get set to ESHUTDOWN while closing.

Reviewed by: dfr
Approved by: re (Ken Smith), kib (mentor)

15 years agoMultiqueue RX is not correctly enabled on the new 82599
jfv [Wed, 1 Jul 2009 16:13:01 +0000 (16:13 +0000)]
Multiqueue RX is not correctly enabled on the new 82599
adapter, the SRRCTL register needs to be setup per queue.

Approved by: re

15 years agoWith NFSv4 ACLs, it is possible that applying a mode to an ACL which
trasz [Wed, 1 Jul 2009 15:52:19 +0000 (15:52 +0000)]
With NFSv4 ACLs, it is possible that applying a mode to an ACL which
is identical to the mode computed from that ACL will modify the ACL.
For example, mode computed from the following ACL is 0600:

   user:kamila:rwx--------C--:------:allow
        owner@:--x-----------:------:deny
        owner@:rw-p---A-W-Co-:------:allow
        group@:rwxp----------:------:deny
        group@:--------------:------:allow
     everyone@:rwxp---A-W-Co-:------:deny
     everyone@:------a-R-c--s:------:allow

However, applying that mode (chmod 0600) changes the ACL into this:

   user:kamila:rwx-----------:------:deny
   user:kamila:rwx--------C--:------:allow
        owner@:--x-----------:------:deny
        owner@:rw-p---A-W-Co-:------:allow
        group@:rwxp----------:------:deny
        group@:--------------:------:allow
     everyone@:rwxp---A-W-Co-:------:deny
     everyone@:------a-R-c--s:------:allow

In chmod(1) utility, there is an optimisation, which makes it not
call chmod(2) if the mode of the file is the same as the new mode.
Disable that optimisation for files which may have NFSv4 ACLs.

Reviewed by: rwatson
Approved by: re (kib)

15 years agoAudit the file descriptor number passed to lseek(2).
rwatson [Wed, 1 Jul 2009 15:37:23 +0000 (15:37 +0000)]
Audit the file descriptor number passed to lseek(2).

Approved by: re (kib)
MFC after: 3 days

15 years agoFix link(2) auditing: use the second audit record path for the new object
rwatson [Wed, 1 Jul 2009 13:22:08 +0000 (13:22 +0000)]
Fix link(2) auditing: use the second audit record path for the new object
name.

Approved by: re (kib)
MFC after: 3 days

15 years ago- Fix the bug in write(2) called with incorrect parameters resulting in writes
stas [Wed, 1 Jul 2009 13:07:02 +0000 (13:07 +0000)]
- Fix the bug in write(2) called with incorrect parameters resulting in writes
  always started from the start of the packet.
- Fix usage string (multiple addresses can be specified).
- Make the source more style(9) compliant.
- Improve error reporting (do not silently fail if something goes
  wrong).
- Make functions static.
- Use warns level 6.

Approved by: re (kib)
Discussed with: Marc Balmer <marc@msys.ch>, brian, mbr

15 years agoudit the 'options' argument to wait4(2).
rwatson [Wed, 1 Jul 2009 12:36:10 +0000 (12:36 +0000)]
udit the 'options' argument to wait4(2).

Approved by: re (kib)
MFC after: 3 days

15 years agoFix infinite loop in ng_iface, that happens when packet passes out via
mav [Wed, 1 Jul 2009 08:08:56 +0000 (08:08 +0000)]
Fix infinite loop in ng_iface, that happens when packet passes out via
two different ng interfaces sequentially due to tunnelling.

PR: kern/134557
Submitted by: Mikolaj Golub
Approved by: re (kensmith)
MFC after: 3 days

15 years agoAdd usr/include/nfs/rpcv2.h
dfr [Wed, 1 Jul 2009 07:37:21 +0000 (07:37 +0000)]
Add usr/include/nfs/rpcv2.h

Submitted by: pluknet at gmail dot com
Approved by: re

15 years agoAdd an entry documenting removal of the NFS_LEGACYRPC option.
dfr [Wed, 1 Jul 2009 07:35:57 +0000 (07:35 +0000)]
Add an entry documenting removal of the NFS_LEGACYRPC option.

Submitted by: Steve Kargl
Approved by: re

15 years agoDon't include rpcv2.h - it has been removed.
dfr [Wed, 1 Jul 2009 07:34:28 +0000 (07:34 +0000)]
Don't include rpcv2.h - it has been removed.

Submitted by: ed@
Approved by: re

15 years agoCompiles without higher warn level
mbr [Tue, 30 Jun 2009 22:09:47 +0000 (22:09 +0000)]
Compiles without higher warn level

M    wake/Makefile

Approved by: re (previous commit)

15 years agoDon't imply that only FTP urls are supported when we can't fetch
brian [Tue, 30 Jun 2009 20:53:57 +0000 (20:53 +0000)]
Don't imply that only FTP urls are supported when we can't fetch
a package.

Approved by: re (kib)
MFC after: 3 weeks

15 years agoMake it clear where to look for for protocol-specific socket options.
trasz [Tue, 30 Jun 2009 20:53:56 +0000 (20:53 +0000)]
Make it clear where to look for for protocol-specific socket options.

Reviewed by: rwatson
Approved by: re (kib)

15 years agoRemove a stale comment. The very same revision (r85511) that introduced
alc [Tue, 30 Jun 2009 19:39:17 +0000 (19:39 +0000)]
Remove a stale comment.  The very same revision (r85511) that introduced
this comment also implemented the proposed change to the code.

Approved by: re (kib)

15 years agoAdjust the internal NFS KPI to avoid the last traces of NFS_LEGACYRPC.
dfr [Tue, 30 Jun 2009 19:10:17 +0000 (19:10 +0000)]
Adjust the internal NFS KPI to avoid the last traces of NFS_LEGACYRPC.

Approved by: re

15 years agoRemove the old kernel RPC implementation and the NFS_LEGACYRPC option.
dfr [Tue, 30 Jun 2009 19:03:27 +0000 (19:03 +0000)]
Remove the old kernel RPC implementation and the NFS_LEGACYRPC option.

Approved by: re

15 years agoAdd wake, a tool to send Wake on LAN frames to hosts on a local Ethernet network
mbr [Tue, 30 Jun 2009 18:51:22 +0000 (18:51 +0000)]
Add wake, a tool to send Wake on LAN frames to hosts on a local Ethernet network

Submitted by:   Marc Balmer <marc@msys.ch>
Reviewed by:    rwatson
Approved by: re

M    usr.sbin/Makefile
A    usr.sbin/wake
AM   usr.sbin/wake/wake.c
AM   usr.sbin/wake/Makefile
AM   usr.sbin/wake/wake.8

15 years agoMake gjournal work with kernel compiled with "options DIAGNOSTIC".
trasz [Tue, 30 Jun 2009 14:34:06 +0000 (14:34 +0000)]
Make gjournal work with kernel compiled with "options DIAGNOSTIC".
Previously, it would panic immediately.

Reviewed by: pjd
Approved by: re (kib)

15 years agoAdd FIONSPACE from NetBSD. FIONSPACE is provided so that programs may
emaste [Tue, 30 Jun 2009 13:38:49 +0000 (13:38 +0000)]
Add FIONSPACE from NetBSD.  FIONSPACE is provided so that programs may
easily determine how much space is left in the send queue; they do not
need to know the send queue size.

NetBSD revisions:
  sys_socket.c r1.41, 1.42
  filio.h r1.9

Obtained from: NetBSD
Approved by: re (kensmith)

15 years ago- Add support to atomically set/clear individual bits of a MSR register
stas [Tue, 30 Jun 2009 12:35:47 +0000 (12:35 +0000)]
- Add support to atomically set/clear individual bits of a MSR register
  via cpuctl(4) driver.  Two new CPUCTL_MSRSBIT and CPUCTL_MSRCBIT ioctl(2)
  calls treat the data field of the argument struct passed as a mask
  and set/clear bits of the MSR register according to the mask value.
- Allow user to perform atomic bitwise AND and OR operaions on MSR registers
  via cpucontrol(8) utility.  Two new operations ("&=" and "|=") have been
  added.  The first one applies bitwise AND operaion between the current
  contents of the MSR register and the mask, and the second performs bitwise
  OR.  The argument can be optionally prefixed with "~" inversion operator.
  This allows one to mimic the "clear bit" behavior by using the command
  like this:
      cpucontrol -m 0x10&=~0x02 # clear the second bit of TSC MSR

  Inversion operator support in all modes (assignment, OR, AND).

Approved by: re (kib)
MFC after: 1 month

15 years agoremove unused/unneeded extern declarations
avg [Tue, 30 Jun 2009 11:16:32 +0000 (11:16 +0000)]
remove unused/unneeded extern declarations

This should result in no changes to compiled code.

Reviewed by: alc
Approved by: re (kib)
MFC after: 1 day

15 years agoFor SU mounts, softdep_fsync() might drop vnode lock, allowing other
kib [Tue, 30 Jun 2009 10:07:33 +0000 (10:07 +0000)]
For SU mounts, softdep_fsync() might drop vnode lock, allowing other
threads to put dirty buffers on the vnode bufobj list. For regular files
and synchronous fsync requests, check for the condition and restart the
fsync vop if a new dirty buffer arrived.

Tested by: pho
Approved by: re (kensmith)
MFC after: 1 month

15 years agoSoftdep_fsync() may need to lock parent directory of the synced vnode.
kib [Tue, 30 Jun 2009 10:07:00 +0000 (10:07 +0000)]
Softdep_fsync() may need to lock parent directory of the synced vnode.
Use inlined (due to FFSV_FORCEINSMQ) version of vn_vget_ino() to prevent
mountpoint from being unmounted and freed while no vnodes are locked.

Tested by: pho
Approved by: re (kensmith)
MFC after: 1 month

15 years agoacpi_wmi_if:
rpaulo [Tue, 30 Jun 2009 09:51:41 +0000 (09:51 +0000)]
acpi_wmi_if:
- Document different semantics for ACPI_WMI_PROVIDES_GUID_STRING_METHOD

acpi_wmi.c:
- Modify acpi_wmi_provides_guid_string_method to return absolut number of
  instances known for the given GUID.

acpi_hp.c:
- sysctl dev.acpi_hp.0.verbose to toggle debug output
- A modification so this can deal with different array lengths
  when reading the CMI BIOS - now it works ok on HP Compaq nx7300
  as well.
- Change behaviour to query only max_instance-1 CMI BIOS instances,
  because all HPs seen so far are broken in that respect
  (or there is a fundamental misunderstanding on my side, possible
  as well). This way a disturbing ACPI Error Field exceeds Buffer
  message is avoided.
- New bit to set on dev.acpi_hp.0.cmi_detail (0x8) to
  also query the highest guid instance of CMI bios

acpi_hp.4:
- Document dev.acpi_hp.0.verbose sysctl in man page
- Document new bit for dev.acpi_hp.0.cmi_detail
- Add a section to manpage about hardware that has been reported
  to work ok

Submitted by: Michael Gmelin, freebsdusb at bindone.de
Approved by: re (kib)
MFC after: 2 weeks

15 years agoIn case we cannot queue a packet reaching the queue limit, retain the
bz [Tue, 30 Jun 2009 05:21:00 +0000 (05:21 +0000)]
In case we cannot queue a packet reaching the queue limit, retain the
semantics netisr_queue() always had and free the mbuf along with
returning the error.

Reviewed by: rwatson
Approved by: re (kensmith)

15 years agoFix build with NFS_LEGACYRPC enabled after the socket upcall locking
jhb [Tue, 30 Jun 2009 03:18:51 +0000 (03:18 +0000)]
Fix build with NFS_LEGACYRPC enabled after the socket upcall locking
changes.

Approved by: re (kensmith)

15 years agoDynamically allocate the gidset field in audit record.
sson [Mon, 29 Jun 2009 20:19:19 +0000 (20:19 +0000)]
Dynamically allocate the gidset field in audit record.

This fixes a problem created by the recent change that allows a large
number of groups per user.  The gidset field in struct kaudit_record
is now dynamically allocated to the size needed rather than statically
(using NGROUPS).

Approved by: re@ (kensmith, rwatson), gnn (mentor)

15 years agoRemove support for the /dev/net/* per-interface devices. They serve
brooks [Mon, 29 Jun 2009 19:46:29 +0000 (19:46 +0000)]
Remove support for the /dev/net/* per-interface devices.  They serve
little purpose and are unused in the base system.

The IOCTL functionality is entirely duplicated and routing sockets
provide a richer interface than the kqueue functionality.

Further, it is not practical for these devices to be made sensible in
the face of VIMAGE.

Bump __FreeBSD_version on the off chance that there is any code out
there that actually uses this stuff.

Reviewed by: rwatson
Discussed with: bz, zec
Approved by: re@ (kensmith)

15 years agoMake the structure definitions in the man pages match the real code, and
kib [Mon, 29 Jun 2009 18:54:17 +0000 (18:54 +0000)]
Make the structure definitions in the man pages match the real code, and
remove no longer valid caution.

Approved by: re (kensmith)

15 years agoUpdate to 3.6.2.2 firmware (latest w/o host-based power save support):
sam [Mon, 29 Jun 2009 18:42:54 +0000 (18:42 +0000)]
Update to 3.6.2.2 firmware (latest w/o host-based power save support):
o new tx ack queue (not used right now)
o proxy-sta related changes (no proxy sta in driver)
o explicit dwds ena/dis (needed only with proxy sta)
o cleanup BA policy handling
o new ampdu aggressive mode support
o CFEnd use now controllable

Approved by: re (kensmith)

15 years agoType problem when FreeBSD is in a virtualized environment, the
jfv [Mon, 29 Jun 2009 18:17:10 +0000 (18:17 +0000)]
Type problem when FreeBSD is in a virtualized environment, the
result was when the RX index wrapped it was converted into some
sort of gibberish and written into the RDT register, effectively
killing the RX side of the thing :)

Approved by: re

15 years agoFree struct ucreds allocated in vfs_hang_addrlist() when deleting
kib [Mon, 29 Jun 2009 18:09:07 +0000 (18:09 +0000)]
Free struct ucreds allocated in vfs_hang_addrlist() when deleting
the export element.
While there, remove register storage-class specifiers.

Reported and tested by: pho
Reviewed by: kan
Approved by: re (kensmith)

15 years agoFix copyrights to reflect the origin of these files.
imp [Mon, 29 Jun 2009 16:45:50 +0000 (16:45 +0000)]
Fix copyrights to reflect the origin of these files.

Approved by: re@ (rwatson)

15 years agoDon't assume a default (currently 15) value for preloaded klds when
attilio [Mon, 29 Jun 2009 16:03:18 +0000 (16:03 +0000)]
Don't assume a default (currently 15) value for preloaded klds when
loading hwpmc, but calculate at runtime and allocate the necessary space.
Also the current logic is wrong as it can lead to an endless loop.

Sponsored by:   Sandvine Incorporated
Reported by:    Ryan Stone <rstone at sandvine dot com>
Tested by:      Giovanni Trematerra
                <giovanni dot trematerra at gmail dot com>
Approved by: re (kib)

15 years agoFix "options VIMAGE_GLOBALS" build following introduction of
rwatson [Mon, 29 Jun 2009 15:23:50 +0000 (15:23 +0000)]
Fix "options VIMAGE_GLOBALS" build following introduction of
in6_ifaddrhead.

Approved by: re (kib)

15 years agoAdd libjail to the boot_crunch binaries (for ifconfig).
jamie [Mon, 29 Jun 2009 13:59:30 +0000 (13:59 +0000)]
Add libjail to the boot_crunch binaries (for ifconfig).

PR: 136071
Submitted by: Scot Hetzel
Approved by: re (kensmith), bz (mentor)

15 years agoDisable Rx checksum offload until I find more clue why it breaks
yongari [Mon, 29 Jun 2009 05:12:21 +0000 (05:12 +0000)]
Disable Rx checksum offload until I find more clue why it breaks
under certain environments. However give users chance to override
it when he/she surely knows his/her hardware works with Rx checksum
offload.

Reported by: Ulrich Spoerlein ( uqs <> spoerlein dot net )
MFC after: 1 week
Approved by: re (kensmith)

15 years agoBack out previous revision until better tested fix is ready.
kan [Mon, 29 Jun 2009 01:33:59 +0000 (01:33 +0000)]
Back out previous revision until better tested fix is ready.

Approved by: re (impliciti, by approving previos check-in)

15 years agoEliminate .text relocations in shared libraries compiled with stack protector.
kan [Sun, 28 Jun 2009 23:51:39 +0000 (23:51 +0000)]
Eliminate .text relocations in shared libraries compiled with stack protector.

Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC generates
local calls to this function which result in absolute relocations put into
position-independent code segment, making dynamic loader do extra work everys
time given shared library is being relocated and making affected text pages
non-shareable.

Reviewed by:        kib
Approved by:        re (kensmith)

15 years ago- Work around the broken loader behavior of not demapping no longer
marius [Sun, 28 Jun 2009 22:42:51 +0000 (22:42 +0000)]
- Work around the broken loader behavior of not demapping no longer
  used kernel TLB slots when unloading the kernel or modules, which
  results in havoc when loading a kernel and modules which take up
  less TLB slots afterwards as the unused but locked ones aren't
  accounted for in virtual_avail. Eventually this should be fixed
  in the loader which isn't straight forward though and the kernel
  should be robust against this anyway. [1]
- Ensure that the addresses allocated directly from phys_avail[] by
  pmap_bootstrap_alloc() are always colored properly. This implicit
  assumption was broken in r194784 as unlike the other consumers the
  DPCPU area allocated for the BSP isn't a multiple of PAGE_SIZE *
  DCACHE_COLORS. [2]
- Remove the no longer used global msgbuf_phys.
- Remove the redundant ekva parameter of pmap_bootstrap_alloc().
- Correct some outdated function names in ktr(9) invocations.

Requested by: jhb [1]
Reported by: gavin [2]
Approved by: re (kib)
MFC after: 2 weeks

15 years ago- Turn the third (islocked) argument of the knote call into flags parameter.
stas [Sun, 28 Jun 2009 21:49:43 +0000 (21:49 +0000)]
- Turn the third (islocked) argument of the knote call into flags parameter.
  Introduce the new flag KNF_NOKQLOCK to allow event callers to be called
  without KQ_LOCK mtx held.
- Modify VFS knote calls to always use KNF_NOKQLOCK flag.  This is required
  for ZFS as its getattr implementation may sleep.

Approved by: re (rwatson)
Reviewed by: kib
MFC after: 2 weeks