Commit Graph

83037 Commits

Author SHA1 Message Date
Bjoern A. Zeeb
35fd7bc020 Add infrastructure to allow all frames/packets received on an interface
to be assigned to a non-default FIB instance.

You may need to recompile world or ports due to the change of struct ifnet.

Submitted by:	cjsp
Submitted by:	Alexander V. Chernikov (melifaro ipfw.ru)
		(original versions)
Reviewed by:	julian
Reviewed by:	Alexander V. Chernikov (melifaro ipfw.ru)
MFC after:	2 weeks
X-MFC:		use spare in struct ifnet
2011-07-03 12:22:02 +00:00
Alan Cox
80788b2a27 When iterating over a paging queue, explicitly check for PG_MARKER, instead
of relying on zeroed memory being interpreted as an empty PV list.

Reviewed by:	kib
2011-07-02 23:42:04 +00:00
Alan Cox
a8229fa37c Initialize marker pages as held rather than fictitious/wired. Marking the
page as held is more useful as a safety precaution in case someone forgets
to check for PG_MARKER.

Reviewed by:	kib
2011-07-02 23:34:47 +00:00
Hans Petter Selasky
34e5f64b49 Fix for "nomatch" event for ums and ukbd drivers when uhid is loaded.
MFC after:	3 days
2011-07-02 20:58:33 +00:00
Hans Petter Selasky
910f1dcf71 Fix problem about USB MIDI TX data format, that some devices only accept
a maximum of 4 bytes (one command) per short terminated USB transfer.
Optimise the TX case by sending multiple USB frames.

MFC after:	1 week
2011-07-02 20:26:37 +00:00
Jonathan Anderson
55d4d6f414 Define the CAPABILITIES kernel option.
This option will enable Capsicum capabilities, which provide a fine-grained
mask on operations that can be performed on file descriptors.

Approved by: mentor (rwatson), re (Capsicum blanket ok)
Sponsored by: Google Inc
2011-07-02 15:41:22 +00:00
Ed Schouten
18f5477167 Reintroduce the cioctl() hook in the TTY layer for digi(4).
The cioctl() hook can be used by drivers to add ioctls to the *.init and
*.lock devices. This commit breaks the ttydevsw ABI, since this
structure didn't provide any padding. To prevent ABI breakage in the
future, add a tsw_spare.

Submitted by:	Peter Jeremy <peter jeremy alcatel lucent com>
Obtained from:	kern/152254 (slightly modified)
2011-07-02 13:54:20 +00:00
Marius Strobl
df41287464 UltraSPARC-IV CPUs seem to be affected by a not publicly documented
erratum causing them to trigger stray vector interrupts accompanied by a
state in which they even fault on locked TLB entries. Just retrying the
instruction in that case gets the CPU back on track though. OpenSolaris
also just ignores a certain number of stray vector interrupts.
While at it, implement the stray vector interrupt handling for SPARC64-VI
which use these for indicating uncorrectable errors in interrupt packets.
2011-07-02 12:56:03 +00:00
Marius Strobl
c70f826b25 Don't waste a delay slot. 2011-07-02 11:46:23 +00:00
Marius Strobl
4a35efc720 - For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from
the TLBs in order to get rid of the user mappings but instead traverse
  them an flush only the latter like we also do for the Spitfire-class.
  Also flushing the unlocked kernel entries can cause instant faults which
  when called from within cpu_switch() are handled with the scheduler lock
  held which in turn can cause timeouts on the acquisition of the lock by
  other CPUs. This was easily seen with a 16-core V890 but occasionally
  also happened with 2-way machines.
  While at it, move the SPARC64-V support code entirely to zeus.c. This
  causes a little bit of duplication but is less confusing than partially
  using Cheetah-class bits for these.
- For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024-
  entry, 2-way set associative TLB.
- In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure
  that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back.

Tested by:      Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V)
2011-07-02 11:14:54 +00:00
Marius Strobl
80006832f6 Using .comm to declare intrnames and eintrnames causes binutils 2.17.50 to
merge the two.
2011-07-02 10:17:26 +00:00
Marius Strobl
7d7a4ae1a7 Fix r223695 to compile on architectures which don't use the MBR scheme; wrap
the MBR support in the common part of the loader in #ifdef's and enable it
only for userboot for now.
2011-07-01 18:31:59 +00:00
Jonathan Anderson
07b1b59405 Define cap_rights_t and DTYPE_CAPABILITY, which are required to
implement Capsicum capabilities.

Approved by: mentor (rwatson), re (bz)
2011-07-01 12:13:48 +00:00
Gleb Smirnoff
9b2139a27e Fix double free.
Submitted by:	Alexander V. Chernikov <melifaro ipfw.ru>
2011-07-01 08:27:03 +00:00
Marcel Moolenaar
c412551667 Change the management of nested faults by switching to physical
addressing while reading or writing the trap frame. It's not
possible to guarantee that the one translation cache entry that
we depend on is not going to get purged by the CPU. We already
know that global shootdowns (ptc.g and/or ptc.ga) can (and will)
cause multiple TC entries to get purged and we initialize tried
to handle that by serializing kernel entry with these operations.
However, we need to serialize kernel exit as well.

But even if we can serialize, it appears that CPU threads within
a core can affect each other's TC entries beyond the global
shootdown. This would mean serializing any and all translatation
cache updates with the threads in a core with the kernel entry
and exit of any thread in that core. This is just too painful
and complicated.

Since we already properly coded for the 2 nested faults that we
can get, all we need to do is use those to obtain the physical
address of the trap frame, switch to physical mode and in that
way eliminate any further faults. The trap frame is already
aligned to 1KB boundaries to make sure we don't cross the page
boundary, this is safe to do.

We still need to serialize ptc.g or ptc.ga across CPUs because
the platform can only have 1 such operation outstanding at the
same time. We can now use a regular (spin) lock for this.

Also, it has been observed that we can get a nested TLB faults
for region 7 virtual addresses. This was unexpected. For now,
we enhance the nested TLB fault handler to deal with those as
well, but it needs to be understood.
2011-06-30 20:34:55 +00:00
Alexander Motin
35ded6a6a7 Add ID for Marvell 88SE9125 SATA controller.
PR:		kern/157843
MFC after:	1 week
2011-06-30 19:23:17 +00:00
Michael Tuexen
b845acda75 Add the missing sca_keylength field to the sctp_authkey structure,
which is used the the SCTP_AUTH_KEY socket option.

MFC after: 1 month.
2011-06-30 16:56:55 +00:00
Doug Rabson
9777aa3f12 Add a version of the FreeBSD bootloader which can run in userland, packaged
as a shared library. This is intended to be used by BHyVe to load FreeBSD
kernels into new virtual machines.
2011-06-30 16:08:56 +00:00
Jonathan Anderson
c0467b5e6e When Capsicum starts creating capabilities to wrap existing file
descriptors, we will want to allocate a new descriptor without installing
it in the FD array.

Split falloc() into falloc_noinstall() and finstall(), and rewrite
falloc() to call them with appropriate atomicity.

Approved by: mentor (rwatson), re (bz)
2011-06-30 15:22:49 +00:00
Jonathan Anderson
12bc222e57 Add some checks to ensure that Capsicum is behaving correctly, and add some
more explicit comments about what's going on and what future maintainers
need to do when e.g. adding a new operation to a sys_machdep.c.

Approved by: mentor(rwatson), re(bz)
2011-06-30 10:56:02 +00:00
Warner Losh
f2033ea22b Add detection for the Marvel 88E1149R and treat it just like the
88E1149.
2011-06-30 05:20:02 +00:00
Kirk McKusick
08af0c8b8d Handle the FREEDEP case in softdep_sync_buf().
This fix failed to get added in -r223325.

Submitted by:	Peter Holm
2011-06-29 22:12:43 +00:00
Alan Cox
6bbee8e28a Add a new option, OBJPR_NOTMAPPED, to vm_object_page_remove(). Passing this
option to vm_object_page_remove() asserts that the specified range of pages
is not mapped, or more precisely that none of these pages have any managed
mappings.  Thus, vm_object_page_remove() need not call pmap_remove_all() on
the pages.

This change not only saves time by eliminating pointless calls to
pmap_remove_all(), but it also eliminates an inconsistency in the use of
pmap_remove_all() versus related functions, like pmap_remove_write().  It
eliminates harmless but pointless calls to pmap_remove_all() that were being
performed on PG_UNMANAGED pages.

Update all of the existing assertions on pmap_remove_all() to reflect this
change.

Reviewed by:	kib
2011-06-29 16:40:41 +00:00
John Baldwin
b37e0f6e9a - Add read-only sysctls for all of the tunables supported by the igb and
em drivers.
- Make the per-instance 'enable_aim' sysctl truly per-instance by having it
  change a per-instance variable (which is used to control AIM) rather
  than having all of the per-instance sysctls operate on a single global
  variable.

Reviewed by:	jfv (earlier version)
MFC after:	1 week
2011-06-29 16:20:52 +00:00
Grzegorz Bernacki
acd73f5041 Set proper root device name when legacy NFS client is compiled into kernel.
Approved by:     cognet (mentor)
2011-06-29 15:17:29 +00:00
Hans Petter Selasky
24f4fe9a01 Add support for a MosChip PCI express serial port adapter.
MFC after:	1 week
2011-06-29 14:47:20 +00:00
Adrian Chadd
f52efb6d38 Fix a corner case in STA beacon processing when a CSA is received but
the AP doesn't transmit beacons.

If the AP requests a CSA (ie, a channel switch) and then enters CAC
(channel availability check) for 60 seconds, it doesn't send beacons
and it just listens for radar events (and other things which we don't
do yet.)

Now, ath_newstate() was not resetting the beacon timer config on
a transition to the RUN state when in STA mode - it was setting
sc_syncbeacon, which simply updates the beacon config from the
contents of the next received beacon.

This means the STA never generates beacon miss events.

If the AP goes into CAC for 60 seconds and recovers, the STA will
happily receive the first beacon and reconfigure timers.
But if it gets a radar event after that, it'll change channel
again, not notify the station that it's changed channel..
and since the station is happily waiting for the first beacon
to configure the beacon timer details from, it won't ever
generate a beacon miss interrupt and it'll sit there forever
(or until the AP appears on that channel once again.)

This change forces the last known beacon timer config to be
written to hardware on a transition from CSA->RUN in STA mode.
This forces bmiss events to occur and the STA will eventually
(after a handful of beacon miss events) begin scanning for
another access point.
2011-06-29 13:21:52 +00:00
Jonathan Anderson
24c1c3bf71 We may split today's CAPABILITIES into CAPABILITY_MODE (which has
to do with global namespaces) and CAPABILITIES (which has to do with
constraining file descriptors). Just in case, and because it's a better
name anyway, let's move CAPABILITIES out of the way.

Also, change opt_capabilities.h to opt_capsicum.h; for now, this will
only hold CAPABILITY_MODE, but it will probably also hold the new
CAPABILITIES (implying constrained file descriptors) in the future.

Approved by: rwatson
Sponsored by: Google UK Ltd
2011-06-29 13:03:05 +00:00
Andrey V. Elsukov
9527ec6e52 Add new rule actions "call" and "return" to ipfw. They make
possible to organize subroutines with rules.

The "call" action saves the current rule number in the internal
stack and rules processing continues from the first rule with
specified number (similar to skipto action). If later a rule with
"return" action is encountered, the processing returns to the first
rule with number of "call" rule saved in the stack plus one or higher.

Submitted by:	Vadim Goncharov
Discussed by:	ipfw@, luigi@
2011-06-29 10:06:58 +00:00
Kevin Lo
e6cf436883 Typo
Submitted by:	Damjan Marion <damjan dot marion at gmail dot com>
MFC after:	3 days
2011-06-29 09:35:40 +00:00
Andriy Gapon
147c5f1fc1 add SNDCTL_DSP_HALT specified by OSS
This is really a new name for SNDCTL_DSP_RESET.
And this what commit r222723 should really have been in the first place.

PR:		kern/156874
Submitted by:	gerald
MFC after:	1 week
2011-06-29 08:32:37 +00:00
Andriy Gapon
18a30e639d revert r222723: wrong change was committed
The commit intended to add SNDCTL_DSP_HALT, but actually added
SNDCTL_SEQ_HALT, which is not defined in the OSS specs.

Reported by:	Pan Tsu <inyaoo@gmail.com>
Pointyhat to:	gerald, avg
2011-06-29 08:28:39 +00:00
Andrey V. Elsukov
2b9be05588 Initialize elements of state array when creating the GPT table.
This fixes the problem, when the secondary GPT header is not erased when
partition table destroyed. Move equal operations from g_part_gpt_create
and g_part_gpt_recover to the separate function g_gpt_set_defaults.

Reported by:	dwhite
MFC after:	1 week
2011-06-29 05:41:14 +00:00
Rick Macklem
4875024b26 Fix the new NFSv4 client so that it doesn't fill the cached
mode attribute in as 0 when doing writes. The change adds
the Mode attribute plus the others except Owner and Owner_group
to the list requested by the NFSv4 Write Operation. This fixed
a problem where an executable file built by "cc" would get mode
0111 instead of 0755 for some NFSv4 servers.
Found at the recent NFSv4 interoperability Bakeathon.

Tested by:	tdh at excfb.com
MFC after:	2 weeks
2011-06-28 22:52:38 +00:00
Marius Strobl
2b2f3c09a6 Fix typo in r223648 which was accidentally committed 2011-06-28 16:44:02 +00:00
Marius Strobl
c0e3e9d4d2 - In gem_reset_rx() also reset the RX MAC which is necessary in order to
get it out of a stuck condition that can be caused by GEM_MAC_RX_OVERFLOW.
- In gem_reset_rxdma() call gem_setladrf() in order to reprogram the RX
  filter and restore the previous content of GEM_MAC_RX_CONFIG. While at it
  consistently use the newly introduced sc_mac_rxcfg throughout the driver
  instead of reading the its old content.
- Increment if_iqdrops instead of if_ierrors in case of RX buffer allocation
  failure.
- According to the GEM datasheet the RX MAC should also be disabled in
  gem_setladrf() before changing its configuration.
- Add error messages to gem_disable_{r,t}x() and take advantage of these
  throughout the driver instead of duplicating their functionality all over
  the place.

In joint forces with:	yongari
2011-06-28 16:16:43 +00:00
Bjoern A. Zeeb
e0bfbfce79 Update packet filter (pf) code to OpenBSD 4.5.
You need to update userland (world and ports) tools
to be in sync with the kernel.

Submitted by:	mlaier
Submitted by:	eri
2011-06-28 11:57:25 +00:00
Sergey Kandaurov
235195988b Update ifc_len field of struct ifconf passed for the ioctl SIOCGIFCONF32
(i.e. under COMPAT_FREEBSD32) in case ifconf() returned success to match
the native SIOCGIFCONF behavior.

PR:		kern/158369
Reported by:	Paul Procacci <pprocacci att gmail com>
MFC after:	1 week
2011-06-28 08:41:44 +00:00
Kevin Lo
ee6eac62f7 Remove duplicate header includes 2011-06-28 08:36:48 +00:00
Martin Matuska
fbfed0cda6 Add a new "REFCOMPRESSRATIO" property.
For snapshots, this is the same as COMPRESSRATIO, but for
filesystems/volumes, the COMPRESSRATIO is based on the data "USED" (ie,
includes blocks in children, but not blocks shared with the origin).

This is needed to figure out how much space a filesystem would use if it
were not compressed (ignoring snapshots).

Illumos-gate revision:	13387

Obtained from:	Illumos (Feature #1092)
MFC after:	2 weeks
2011-06-28 07:52:01 +00:00
Martin Matuska
85a418012f Disable vdev cache (readahead) by default.
The vdev cache is very underutilized (hit ratio 30%-70%) and may consume
excessive memory on systems with many vdevs.

Illumos-gate revision:	13346

Obtained from:	Illumos (Bug #175)
MFC after:	1 week
2011-06-28 06:32:35 +00:00
Adrian Chadd
7d12b6e172 Make sure the extended regdomain word is initialised.
As with the AR9285, the AR9287 has a default word of 0x1F which means
all the various bits in that field are set on by default.
2011-06-28 00:01:55 +00:00
Michael Tuexen
3c4401ecab Add support for SCTP_PR_SCTP_NONE which I misded to add.
This constant is defined in the socket API ID.

MFC after: 2 months.
2011-06-27 22:03:33 +00:00
John Baldwin
bda6775d59 Revert the entry point label to 'start' to unbreak the build.
Pointy hat to:	jhb
2011-06-27 21:43:56 +00:00
Pyun YongHyeon
50df388d0e Enable CPUSaver D102 E-step microcode loading for 82551 revision
0x10.
2011-06-27 21:37:38 +00:00
Pyun YongHyeon
e8449b7908 Disable microcode loading for 82550 and 82550C controllers. Loading
the microcode caused SCB timeouts. Linux driver does not allow
microcode loading for these controllers and jfv also confirmed that
there is no need to do and it shouldn't.

PR:				kern/103332
Additional confirmation from:	jfv
MFC after:			1 week
2011-06-27 21:27:12 +00:00
John Baldwin
4c7b01b9f8 - Remove the fake BPB from zfsldr. zfsldr doesn't support booting from
floppies, so it will not be used as the start of an emulated floppy
  image on a bootable CD which is what the fake BPB was used for.
- Only check that EDD packet mode is available once at the start of
  zfsldr rather than for each disk sector now that we read data in one
  sector at a time.  As a result, collapse the remaining bits of read
  up into nread and rename nread to read.
- Restore a return at the end of putstr that I removed in the previous
  revision.

Tested by:	Henri Hennebert (earlier version)
MFC after:	1 week
2011-06-27 13:58:24 +00:00
Andrey V. Elsukov
671dfdbf11 EBR could contain an early stage of boot code. But we do not support it.
Remove message about non empty bootcode, we can not break something
while GEOM_PART_EBR_COMPAT is defined.

But without GEOM_PART_EBR_COMPAT any changes in EBR are allowed and we
can accidentally wipe the boot code. To do not break anything save
the first EBR chunk and keep it untouched each time when we are
changing EBR. Note that we are still not support boot code for EBR.

PR:		kern/141235
MFC after:	1 month
2011-06-27 12:42:48 +00:00
Gleb Smirnoff
812f1d32e7 Add possibility to pass IPv6 packets to a divert(4) socket.
Submitted by:	sem
2011-06-27 12:21:11 +00:00
Andrey V. Elsukov
61162e857a MS Windows NT+ uses 4 bytes at offset 0x1b8 in the MBR to identify
disk drive. The boot0cfg(8) utility preserves these 4 bytes when is
writing bootcode to keep a multiboot ability.
Change gpart's bootcode method to keep DSN if it is not zero. Also
do not allow writing bootcode with size not equal to MBRSIZE.

PR:		kern/157819
Tested by:	Eir Nym
MFC after:	1 month
2011-06-27 10:42:06 +00:00