Commit Graph

178740 Commits

Author SHA1 Message Date
Pedro F. Giffuni
757224cbdb ext2fs: general cleanup.
- Remove unused extern declarations in fs.h
- Correct comments in ext2_dir.h
- Several panic() messages showed wrong function names.
- Remove commented out stray line in ext2_alloc.c.
- Remove the unused macro EXT2_BLOCK_SIZE_BITS() and the then
  write-only member e2fs_blocksize_bits from struct m_ext2fs.
- Remove the unused macro EXT2_FIRST_INO() and the then write-only
  member e2fs_first_inode from struct m_ext2fs.
- Remove EXT2_DESC_PER_BLOCK() and the member e2fs_descpb from
  struct m_ext2fs.
- Remove the unused members e2fs_bmask, e2fs_dbpg and
  e2fs_mount_opt from struct m_ext2fs
- Correct harmless off-by-one error for fspath in ext2_vfsops.c.
- Remove the unused and broken macros EXT2_ADDR_PER_BLOCK_BITS()
  and EXT2_DESC_PER_BLOCK_BITS().
- Remove the !_KERNEL versions of the EXT2_* macros.

Submitted by:	Christoph Mallon
MFC after:	2 weeks
2013-02-02 22:23:45 +00:00
Marius Strobl
ba514351d1 Improve r238673 to additionally allow for odd-aligned buffers as
passed in by smartd of smartmontools.
While at it, hint the compiler that 32-bit PIO is the most likely
case (idea from Linux) and use bus_{read,write}_stream_2(9) instead
of bus_{read,write}_multi_stream_2(9) for single count reads/writes.

MFC after:	1 week
2013-02-02 21:57:06 +00:00
Pedro F. Giffuni
96acb2c4fa crunch: Sync some NetBSD changes.
crunchide:
Apr 11, 2009: fix some -Wsign-compare issues.
Sep 20, 1999: Free the right thing.

crunchgen:
Apr 14, 2009: Fix some WARNS=4 issues (-Wshadow -Wcast-qual)
Oct 30, 2004: Add (unsigned char) cast to ctype functions
Feb 5, 2001: fix nested extern.

examples:
Aug 30, 2007: NetBSD 36867 - trsp references are deprecated

Obtained from:	NetBSD
MFC after:	1 week
2013-02-02 21:51:14 +00:00
Hajimu UMEMOTO
e695500d3c Use the default policy table of RFC 6724.
MFC after:	1 weeks
2013-02-02 18:08:09 +00:00
Andriy Gapon
8eede5c4d9 fix some fat-fingering in r246246
Submitted by:	mjg
Pointyhat to:	avg
MFC after:	5 days
X-MFC with:	r246246
2013-02-02 14:19:50 +00:00
Andriy Gapon
ebbed20df4 revert accidentally committed unneeded changes from r246250
MFC after:	7 days
X-MFC with:	r246250
2013-02-02 12:52:43 +00:00
Andriy Gapon
b913a7d5d7 acpi: clear power button status bit after waking up...
so that it is not confused for a new power off request.

Learned from:	Linux and ACPI specification
Tested by:	gjb
MFC after:	12 days
2013-02-02 12:44:19 +00:00
Andriy Gapon
b1a5c01749 acpi: after wakeup from a state > S1 re-enable SCI_EN with a direct write
This hack is picked up from Linux, which claims that it follows
Windows behavior.

PR:		amd64/174409
Tested by:	Sergey V. Dyatko <sergey.dyatko@gmail.com>,
		KAHO Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>,
		Slawa Olhovchenkov <slw@zxy.spb.ru>
MFC after:	13 days
2013-02-02 12:42:07 +00:00
Andriy Gapon
1a89ca4cf5 cpususpend_handler: mark AP as resumed only after fully setting up lapic
Reviewed by:	jhb
Tested by:	Sergey V. Dyatko <sergey.dyatko@gmail.com>,
		KAHO Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
MFC after:	12 days
2013-02-02 12:04:32 +00:00
Andriy Gapon
548b201607 x86 suspend/resume: suspend pics and pseudo-pics in reverse order
- change 'pics' from STAILQ to TAILQ
- ensure that Local APIC is always first in 'pics'

Reviewed by:	jhb
Tested by:	Sergey V. Dyatko <sergey.dyatko@gmail.com>,
		KAHO Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
MFC after:	12 days
2013-02-02 12:02:42 +00:00
Andriy Gapon
bfdcb3bcba print compiler version in the kernel banner
And provide kernel compiler version as a sysctl as well.
This is useful while we have gcc and clang cohabitation.
This could be even more useful when we have support
for external toolchains.

In cooperation with:	mjg
MFC after:		13 days
2013-02-02 11:58:35 +00:00
Andriy Gapon
499f60b10b ng_ether: track interface renaming
Also sanitize interface names that can potentially contain characters
that are prohibited in netgraph names.

PR:		kern/154850 (sanitizing of names)
Discussed with:	eri, melifaro
Submitted by:	Nikolay Denev <ndenev@gmail.com> (sanitizing code)
Reviewed by:	eri, glebius
MFC after:	17 days
2013-02-02 11:54:00 +00:00
Andriy Gapon
5583e07188 solaris compat: remove KM_ZERO
- there is no such flag in Solaris and derivatives
- the flag was added in an unrelated change
- the flag is not used

The proper way to allocate zeroed out memory is to use kmem_zalloc.

MFC after:	3 days
2013-02-02 11:41:05 +00:00
Andriy Gapon
5b23b1b9e7 uart: add resume method and enable it for attachments on the most common
x86 buses

Otherwise the uart hardware could be in such a state after the resume
where IER is cleared and thus no interrupts are generated.

This behavior is observed and tested with QEMU, so I am comitting this
change to help with my debugging.
There has been no feedback from users of serial ports on real hardware.

MFC after:	20 days
2013-02-02 11:38:26 +00:00
Andriy Gapon
13235aaa89 zfs: add MODULE_VERSION for zfsctrl
This should allow the kernel linker to easily detect a situation
when the module is present both in a kernel and in a preloaded file
(zfs.ko).

Reviewed by:	jhb
MFC after:	5 days
2013-02-02 11:35:18 +00:00
Tim Kientzle
3fd25813ed Fix an obvious typo that broke time specifications of the form
"2 hours ago".
2013-02-02 06:06:39 +00:00
Tim Kientzle
de52ceebca Tweaks to standard BEAGLEBONE config, as recently discussed
on FreeBSD-ARM.
2013-02-02 06:01:57 +00:00
Adrian Chadd
4501b24689 Allow IEEE80211_SUPPORT_SUPERG to be defined _and_ have a working wlan
module.
2013-02-02 02:00:29 +00:00
Adrian Chadd
9da01550a9 Wrap this in an #ifdef so IEEE80211_SUPPORT_SUPERG will work correctly
in a wlan.ko module.
2013-02-02 02:00:10 +00:00
Simon J. Gerraty
3cbdda60ff Merge bmake-20130123
Approved by:	marcel (mentor)
2013-02-01 22:55:27 +00:00
Eitan Adler
4752ed3d7f Remove support for plip from the GENERIC kernel as no systems in the
last 10 years require this support.

Discussed with:	db
Discussed with:	kib
Reviewed by:	imp
Reviewed by:	jhb
Reviewed by:	-hackers
Approved by:	cperciva (mentor)
2013-02-01 20:17:11 +00:00
Neel Natu
609933c61b Display MSI-X table and PBA offsets when displaying information about MSI-X
capability.

Reviewed by:	jhb, jimharris (initial version)
2013-02-01 19:24:16 +00:00
Konstantin Belousov
11fca81ccd The MSDOSFSMNT_WAITONFAT flag is bogus and broken. It does less than
track the MNT_SYNCHRONOUS flag.  It is set to the latter at mount time
but not updated by MNT_UPDATE.

Use MNT_SYNCHRONOUS to decide to write the FAT updates syncrhonously.

Submitted by:	bde
MFC after:	1 week
2013-02-01 18:30:41 +00:00
Konstantin Belousov
79fb7dd167 Backup FATs were sometimes marked dirty by copying their first block
from the primary FAT, and then they were not marked clean on unmount.
Force marking them clean when appropriate.

Submitted by:	bde
MFC after:	1 week
2013-02-01 18:25:53 +00:00
Konstantin Belousov
9ec062dddd The directory entry for dotdot was corrupted in the FAT32 case when moving
a directory to a subdir of the root directory from somewhere else.

For all directory moves that change the parent directory, the dotdot
entry must be fixed up.  For msdosfs, the root directory is magic for
non-FAT32.  It is less magic for FAT32, but needs the same magic for
the dotdot fixup.  It didn't have it.

Both chkdsk and fsck_msdosfs fix the corrupt directory entries with no
problems.

The fix is to use the same magic for dotdot in msdosfs_rename() as in
msdosfs_mkdir().

For msdosfs_mkdir(), document the magic. When writing the dotdot entry
in mkdir, use explicitly set pcl variable instead on relying on the
start cluster of the root directory typically has a value < 65536.

Submitted by:	bde
MFC after:	1 week
2013-02-01 18:06:06 +00:00
Konstantin Belousov
48efa33b49 The mountmsdosfs() function had an insane sanity test, remove it.
Trying FAT32 on a small partition failed to mount because
pmp->pm_Sectors was nonzero.  Normally, FAT32 file systems are so
large that the 16-bit pm_Sectors can't hold the size.  This is
indicated by setting it to 0 and using only pm_HugeSectors.  But at
least old versions of newfs_msdos use the 16-bit field if possible,
and msdosfs supports this except for breaking its own support in the
sanity check.  This is quite different from the handling of pm_FATsecs
-- now the 16-bit value is always ignored for FAT32 except for
checking that it is 0, and newfs_msdos doesn't use the 16-bit value
for FAT32.

Submitted by:	bde
MFC after:	1 week
2013-02-01 18:01:03 +00:00
Konstantin Belousov
a26b949f2d Fix a backwards comment in markvoldirty().
Submitted by:	bde
MFC after:	1 week
2013-02-01 17:58:37 +00:00
Neel Natu
445e089e21 Add support for MSI-X interrupts in the virtio block device and make that
the default.

The current behavior of advertising a single MSI vector can be requested by
setting the environment variable "BHYVE_USE_MSI" to "yes". The use of MSI
is not compliant with the virtio specification and will be eventually phased
out.

Submitted by:	Gopakumar T
Obtained from:	NetApp
2013-02-01 16:58:59 +00:00
Konstantin Belousov
dd6035234a Assert that the mbuf in the chain has sane length. Proper place for
this check is somewhere in the network code, but this assertion
already proven to be useful in catching what seems to be driver bugs
causing NFS scrambling random memory.

Discussed with:	rmacklem
MFC after:	1 week
2013-02-01 16:57:02 +00:00
Konstantin Belousov
e7f1427dd2 The change to reduce default smp_tsc_shift caused tsc shift to become
zero on slower machines, which make the fenced get_timecount methods
not used despite needed.  Remove the (shift > 0) condition when
selecting the get_timecount() implementation.

Rename smp_tsc_shift to tsc_shift, and apply it for the UP case too.
Allow shift to reach value of 31 instead of 30, as it was previously
(should be nop).

Reorganize the tc quality calculation to remove the conditionally
compiled block.  Rename test_smp_tsc() to test_tsc() and provide
separate versions for SMP and UP builds.  The check for virtialized
hardware is more natural to perform in the smp version of the
test_tsc(), since it is only done for smp case.

Noted and reviewed by:	bde (previous version)
MFC after:	12 days
2013-02-01 16:48:55 +00:00
John Baldwin
0d25fab44d Add placeholder constants to reserve a portion of the socket option
name space for use by downstream vendors to add custom options.

MFC after:	2 weeks
2013-02-01 15:32:20 +00:00
Philippe Charnier
acd8b77456 Change old-style function definition 2013-02-01 14:26:54 +00:00
Andre Oppermann
cda3447bb0 uma_zone_set_max() directly returns the rounded effective zone
limit.  Use the return value directly instead of doing a second
uma_zone_set_max() step.

MFC after:	1 week
2013-02-01 14:21:09 +00:00
Andre Oppermann
8291b48244 Remove unused VM_MAX_AUTOTUNE_NMBCLUSTERS define. 2013-02-01 14:16:37 +00:00
Pietro Cerutti
71796d333c - Fix more style(9)-related issues (copyright header, spaces after function
names, unnecessary casts)
- Change type of boolean variable from char to bool

Suggested by:	jhb, zont, jmallett
Reviewed by:	cognet
Approved by:	cognet
2013-02-01 13:04:06 +00:00
Grzegorz Bernacki
2d7d16429c Get time of next event from other cores only if SMP is already started.
Reviewed by: mav
Obtained from: Semihalf
2013-02-01 11:39:03 +00:00
Andre Oppermann
1211375f6e Add VM_KMEM_SIZE_SCALE parameter set to 2 (50%) for all ARM platforms.
VM_KMEM_SIZE_SCALE specifies which fraction of the available physical
memory, after deduction of the kernel itself and other early statically
allocated memory, can be used for the kmem_map.  The kmem_map provides
for all UMA/malloc allocations in KVM space.

Previously ARM was using a fixed kmem_map size of (12*1024*1024) = 12MB
without regard to effectively available memory.  This is too small for
recent ARM SoC with more than 128MB of RAM.

For reference a description of others related kmem_map parameters:

 VM_KMEM_SIZE		default start size of kmem_map if SCALE is
			not defined
 VM_KMEM_SIZE_MIN	hard floor on the kmem_map size
 VM_KMEM_SIZE_MAX	hard ceiling on the kmem_map size
 VM_KMEM_SIZE_SCALE	fraction of the available real memory to
			be used for the kmem_map, limited by the
			MIN and MAX parameters.

Tested by:	ian
MFC after:	1 week
2013-02-01 10:26:31 +00:00
Hans Petter Selasky
664413a163 Fix for hardware checksum offloading in SMSC driver.
This also fixes IPv6 support for this particular hardware.

Submitted by:	Daisuke Aoyama
2013-02-01 07:26:25 +00:00
Hans Petter Selasky
39700e098d Include SMSC driver into default kernel build. 2013-02-01 07:19:19 +00:00
Hans Petter Selasky
7b0866b032 Make use of USB ID sections configurable. 2013-02-01 07:05:43 +00:00
Neel Natu
8caac1d5ba Delete the "blackhole" driver - it is not needed anymore.
The "blackhole" driver was used in conjunction with bhyve to sequester
pci devices intended for passthru until vmm.ko was loaded. This was
useful at one point because vmm.ko could not be loaded at boot time.

The same functionality can now be achieved by loading vmm.ko via the
loader along with the kernel.

Discussed with:	grehan
Obtained from:	NetApp
2013-02-01 06:40:53 +00:00
Daniel Eischen
605e5bbc41 Prevent a null pointer dereference in pw userdel when deleting
a user whose group != username.
2013-02-01 05:19:49 +00:00
Neel Natu
2b89a04496 Fix a broken assumption in the passthru implementation that the MSI-X table
can only be located at the beginning or the end of the BAR.

If the MSI-table is located in the middle of a BAR then we will split the
BAR into two and create two mappings - one before the table and one after
the table - leaving a hole in place of the table so accesses to it can be
trapped and emulated.

Obtained from:	NetApp
2013-02-01 03:49:09 +00:00
Neel Natu
aa12663f49 Fix a bug in the passthru implementation where it would assume that all
devices are MSI-X capable. This in turn would lead it to treat bar 0 as
the MSI-X table bar even if the underlying device did not support MSI-X.

Fix this by providing an API to query the MSI-X table index of the emulated
device. If the underlying device does not support MSI-X then this API will
return -1.

Obtained from:	NetApp
2013-02-01 02:41:47 +00:00
Neel Natu
07044a96d8 Increase the number of passthru devices supported by bhyve.
The maximum length of an environment variable puts a limitation on the
number of passthru devices that can be specified via a single variable.
The workaround is to allow user to specify passthru devices via multiple
environment variables instead of a single one.

Obtained from:	NetApp
2013-02-01 01:16:26 +00:00
Pawel Jakub Dawidek
4bbe7b0c20 Now that MPSAFE flag is gone, we can arrange code a bit better. 2013-01-31 22:20:05 +00:00
Pawel Jakub Dawidek
b108953c6f Remove leftover label after Giant removal from VFS. 2013-01-31 22:15:41 +00:00
Pawel Jakub Dawidek
a2c496ebb9 Remove label that was accidentally moved during Giant removal from VFS. 2013-01-31 22:14:16 +00:00
Pawel Jakub Dawidek
9e2677fd6d Simplify code a bit. This is leftover after Giant removal from VFS. 2013-01-31 22:12:48 +00:00
Jilles Tjoelker
58570ac4a5 sh: Prefer our character classification functions to <ctype.h>. 2013-01-31 22:10:57 +00:00