Commit Graph

99571 Commits

Author SHA1 Message Date
Mateusz Guzik
8b04bbef31 Return real parent pid in kinfo (used by e.g. ps)
Add a separate field which exports tracer pid and add a new keyword
("tracer") for ps to display it.

This is a follow up to r270444.

Reviewed by:	kib
MFC after:	1 week
Relnotes:	yes
2014-08-28 08:41:11 +00:00
Adrian Chadd
18aabe98d0 Inform the rate control code if a single frame AMPDU transmission succeeds
but has some retries.

Without this, single frame transmission in AMPDU will always look like
it succeeded fine, and thus AMRR will think it's totally fine to just
keep upping the rate upwards.

Now, this is still not quite right!  For multi-frame aggregates the
completion happens in two parts - the TX done and the BA received.
The driver is currently double accounting those a little - there's no
way to say to the rate control code "I completed X frames, Y worked fine,
there were Z retries." And it's a bit odd with iwn, as the firmware
retransmits frames for us so we don't get to see how many retransmits
happened; only that it took longer than normal.  I may have to extend
the rate control API to properly track that.

So this may keep the rate lower than it should be, but that's better
than keeping it higher than it should be.

Tested:

* 5100, STA mode
2014-08-28 07:44:59 +00:00
Adrian Chadd
bc0203e201 Fix antenna configuration, microcode version checks and rate selection
in preparation for the 5300 3x3 NIC.

During this particular adventure, I did indeed discover that a whole
swath of things made little to no sense.

Those included, and are fixed here:

* A lot of the antenna configuration bits assume the NIC has two receive
  chains.  That's blatantly untrue for NICs that don't.
* There was some disconnect between the antenna configuration when
  forming a PLCP rate DWORD (which includes the transmit antenna
  configuration), separate to the link quality antenna configuration.

  So now there's helper functions to return which antenna configurations
  to use and those are used wherever an antenna config is required.

* The 5300 does up to three stream TX/RX (so MCS0->23), however
  the link quality table has only 16 slots.  This means all of the
  rate entries are .. well, dual-stream rates.  If this is the case,
  the "last MIMO" parameter can't be 16 or it panics the firmware.
  Set it to 15.

* .. and since yes it has 16 slots, it only would try retransmitting
  from MCS8->MCS23, which can be quite .. terrible.  Hard-code the last
  two retry slots to be the lowest configured rate.

* I noticed some transmit configuration command stuff is different
  based on firmware API version, so I lifted that code from Linux.

* Add / augment some more logging to make it easier to capture this
  stuff.

Now, 3x3 is still terrible because the link quality configuration is
plainly not good enough.  I'll have to think about that.
However, the original goal of this - 3x3 operation on the Intel
5300 NIC - actually worked.

There are also rate control bugs in the way this driver handles
notifying the net80211 rate control code when AMPDU is enabled.
It always steps the rate up to the maximum rate possible - and
this eventually ends in much sadness.  I'll fix that later.

As a side note - 2GHz HT40 now works on all the NICs I have tested.

As a second side note - this exposed some bad 3x3 behaviour in
the ath(4) rate control code where it starts off at a 3-stream rate
and doesn't downgrade quickly enough.  This makes the initial
dhcp exchange take a long time.  I'll fix the ath(4) rate code
to start at a low fixed 1x1 MCS rate and step up if everything
works out.

Tested:

* Intel 2200
* Intel 2230
* Intel 5300
* Intel 5100
* Intel 6205
* Intel 100

TODO:

* Test the other NICs more thoroughly!

Thank you to Michael Kosarev <russiane39@gmail.com> for donating the
Intel 5300 NIC and pestering me about it since last year to try and
make it all work.
2014-08-28 03:18:27 +00:00
Adrian Chadd
720e6a9c6f Add iwn-100 firmware.
The firmware is from the Linux firmware git repository; the intel
licence is the same as other firmware blobs.

Tested: iwn1: <Intel Centrino Wireless-N 100> mem 0xf4800000-0xf4801fff irq 19 at device 0.0 on pci5
2014-08-28 00:05:02 +00:00
Jean-Sébastien Pédron
fa2694eec8 vt(4): If the terminal shrinks, make sure the mouse is inside the new area
MFC after:	1 week
2014-08-27 17:16:52 +00:00
Jean-Sébastien Pédron
84d623c61e vt(4): Fix mouse cursor handling in vt_fb/creator_vt/ofwfb
There were two issues:
    1. The area given to vt_is_cursor_in_area() was adding the drawable
       area offset, something already handled by this function.
    2. The cursor was shifted on the screen by the offset of this area
       and thus was misplaced or not erased. Furthermore, when reaching
       the bottom or right borders, the cursor was either totally
       removed or not erased correctly.

MFC after:	1 week
2014-08-27 15:10:28 +00:00
Hans Petter Selasky
c7818b48b6 - Update the OFED Linux Emulation layer as a preparation for a
hardware driver update from Mellanox Technologies.
- Remove empty files from the OFED Linux Emulation layer.
- Fix compile warnings related to printf() and the "%lld" and "%llx"
format specifiers.
- Add some missing 2-clause BSD copyrights.
- Add "Mellanox Technologies, Ltd." to list of copyright holders.
- Add some new compatibility files.
- Fix order of uninit in the mlx4ib module to avoid crash at unload
using the new module_exit_order() function.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2014-08-27 13:21:53 +00:00
Jean-Sébastien Pédron
c0b72c11ea vt(4): Recompute the drawable area when the resolution changes
This was only done when the font changed.

MFC after:	1 week
2014-08-27 11:27:48 +00:00
Jean-Sébastien Pédron
fba582e5f4 vt(4): Pause the vt_flush() timer when the screen is up-to-date
The timer is restarted whenever a window buffer is marked as dirty or
the mouse cursor moves.

There's still room for improvement. For instance, we should not mark a
window buffer as dirty when this window isn't displayed.

Review:		https://reviews.freebsd.org/D683
Reviewed by:	ray@
Approved by:	ray@
MFC after:	1 week
2014-08-27 11:08:09 +00:00
Jean-Sébastien Pédron
1097780459 drm: Don't "taskqueue" vt-switch if under DDB/panic situation
If DDB is active, we can't use a taskqueue thread to switch away from
the X window, because this thread can't run.

Reviewed by:	ray@
Approved by:	ray@
MFC after:	1 week
2014-08-27 10:07:08 +00:00
Jean-Sébastien Pédron
3e206539a1 vt(4): Add cngrab() and cnungrab() callbacks
They are used when a panic occurs or when entering a DDB session for
instance.

cngrab() forces a vt-switch to the console window, no matter if the
original window is another terminal or an X session. However, cnungrab()
doesn't vt-switch back to the original window currently.

MFC after:	1 week
2014-08-27 10:04:10 +00:00
Jean-Sébastien Pédron
d3773c6e8e vt(4): Implement basic support for KDSETMODE ioctl
With the current implementation, this allows an X11 server to tell
the console it switches a particular window in "graphics mode". This
information is used by the mouse handling code to ignore sysmouse events
in the window taken by the X server: only him should receive those
events.

Reported by:	flo@, glebius@, kan@
Tested by:	flo@
Reviewed by:	kan@
MFC after:	1 week
2014-08-27 09:34:41 +00:00
Konstantin Belousov
5aec07c73d Regen. 2014-08-27 01:02:19 +00:00
Konstantin Belousov
8fbeebf590 Fix handling of the third argument for fcntl(2). The native syscall
uses long for arg, which needs translation.

Discussed with and tested by:	mjg
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-08-27 01:02:02 +00:00
Peter Grehan
fc3dde9099 Implement the 0x2B SUB instruction, and the OR variant of 0x81.
Found with local APIC accesses from bitrig/amd64 bsd.rd, 07/15-snap.

Reviewed by:	neel
MFC after:	3 days
2014-08-27 00:53:56 +00:00
Michael Tuexen
76031b19ef Announce SCTP support in the kern.features sysctl variables.
MFC after: 3 days
2014-08-26 21:15:34 +00:00
Jean-Sébastien Pédron
cb81897a72 vt(4): When creating a window buffer, fill it entirely
... not just the visible part.

This fixes a bug where, when switching from eg. vt_vga to vt_fb (ie. the
resolution goes up), the originally hidden, uninitialized area of the
buffer is displayed on the screen. This leads to a missing text cursor
when it's over an unitialized area.

This was also visible when selecting text: the uninitialized area was
not highlighted.

Internally, this area was zeroed: characters were all 0x00000000,
meaning the foreground and background color was black. Now, everything
is filled with a space with a gray foreground color, like the visible
area.

While here, remove the check for the mute flag and always use
TERMINAL_NORM_ATTR as the character attribute (ie. gray foreground,
black background).

MFC after:	1 week
2014-08-26 17:48:05 +00:00
Alan Cox
9452b5eda9 Back in the days when the kernel was single threaded, testing
"vm_paging_target() > 0" was a reasonable way of determining if the
inactive queue scan met its target.  However, now that other threads
can be allocating pages while the inactive queue scan is running, it's
an unreliable method.  The effect of it being unreliable is that we
can start swapping out processes when we didn't intend to.

This issue has existed since the kernel was multithreaded, but the
changes to the inactive queue target in 10.0-RELEASE have made its
effects visible.

This change introduces a more direct method for determining if the
inactive queue scan met its target that is not affected by the actions
of other threads.

Reported by:	Steve Polyack
Tested by:	pho, Steve Polyack (an earlier version)
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2014-08-26 16:40:20 +00:00
Gleb Smirnoff
e86447ca44 - Remove socket file operations declaration from sys/file.h.
- Make them static in sys_socket.c.
- Provide generic invfo_truncate() instead of soo_truncate().

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2014-08-26 14:44:08 +00:00
Mateusz Guzik
037755fd15 Fix up races with f_seqcount handling.
It was possible that the kernel would overwrite user-supplied hint.

Abuse vnode lock for this purpose.

In collaboration with: kib
MFC after:	1 week
2014-08-26 08:17:22 +00:00
Kevin Lo
15cb19cd6a Fix typo: s/mac_rev/mac_ver/
Submitted by:	Stefan Sperling <stsp at openbsd dot org>
2014-08-26 02:20:37 +00:00
Jean-Sébastien Pédron
af9f67ea3d vt_vga: Use Write Mode 0 to draw group of 8 pixels using 3 or more colors
This replaces the method based on Write Mode 3, which required reads
from the video memory to load the latches.

MFC after:	1 week
2014-08-25 20:15:19 +00:00
Jean-Sébastien Pédron
a8ca6ae235 vt(4): Intialize drawable area rectangle each time a font is loaded
This also fixes a problem where early in boot, the area was zero,
leading to nothing displayed for a few seconds.

MFC after:	1 week
2014-08-25 19:52:13 +00:00
Jean-Sébastien Pédron
83fbb296a9 vt(4): Store a rectangle for the drawable area, not just the top-left corner
This allows backends to verify they do not draw outside of this area.
This fixes a bug in vt_vga where the text was happily drawn over the
right and bottom margins, when using the Gallant font.

MFC after:	1 week
2014-08-25 19:06:31 +00:00
Jean-Sébastien Pédron
7e802e4968 vt(4): The cursor coordinates are relative to the drawn area
... not the whole screen. Don't use font offsets in
vt_mark_mouse_position_as_dirty().

This fixes a bug where the mouse position wasn't marked as dirty when
approaching the borders of the drawn area.

MFC after:	1 week
2014-08-25 17:08:38 +00:00
Davide Italiano
266d427bc0 Rather than using an hardcoded reclaim age, rely on an LRU-like approach
for dirhash cache, setting a target percent to reclaim (exposed via
SYSCTL). This allows to always make some amount of progress keeping the maximum
reclaim age dynamic.

Tested by:      pho
Reviewed by:	jhb
2014-08-25 17:06:18 +00:00
Jean-Sébastien Pédron
0878762c5b vt(4): Take font offset into account in vt_is_cursor_in_area()
This fixes a "General protection fault" in vt_vga, where
vt_is_cursor_in_area() erroneously reported that the cursor was over the
text. This led to negative integers stored in "unsigned int" and chaos.

MFC after:	1 week
2014-08-25 16:56:33 +00:00
Jean-Sébastien Pédron
42782caf9b drm/i915: Disable the build of i915 on PC98
This module is of no use on this platform and now, i915 depends on ACPI
anyway.

Suggested by:	nyan@
2014-08-25 14:58:36 +00:00
Jean-Sébastien Pédron
762582f060 drm/i915: Add opt_acpi.h and acpi_if.h to the source files
While here, sort the list of generated source files.
2014-08-25 14:55:56 +00:00
Andrey V. Elsukov
94be23b653 Since the size of GPT entry may differ from the sizeof(struct gpt_ent),
use the size from GPT header to iterate entries.

Suggested by:	marcel@
MFC after:	1 week
2014-08-25 07:15:14 +00:00
Adrian Chadd
a39b467a26 i915 driver - enable opregion handle; program CADL.
add opregion handling for drm2 - which exposes some ACPI video configuration
pieces that some Lenovo laptop models use to flesh out which video device
to speak to.  This enables the brightness control in ACPI to work these models.

The CADL bits are also important - it's used to figure out which ACPI
events to hook the brightness buttons into.  It doesn't yet seem to work
for me, but it does for the OP.

Tested:

* Lenovo X230 (mine)
* OP: ASUS UX51VZ

PR:	190186
Submitted by:	Henry Hu <henry.hu.sh@gmail.com>
Reviewed by:	dumbbell
2014-08-25 05:03:10 +00:00
Mark Johnston
35127d3c0f Restore the correct value when disabling probes. Otherwise the instrumented
tracepoints would continue to generate traps, which would be ignored but
could consume noticeable amounts of CPU if, say, all functions in the kernel
were instrumented.

X-MFC-With:	r270067
2014-08-24 17:10:47 +00:00
Edward Tomasz Napierala
7cb570d0ae Fix bug that, assuming a/ is a root of NFS filesystem mounted on autofs,
prevented "mv a/from a/to" from working, while "cd a && mv from to" was ok.

PR:		192948
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-24 17:03:52 +00:00
Konstantin Belousov
c83655f334 Revert the handling of all siginfo sa_flags except SA_SIGINFO to the
pre-r270321.  Namely, the flags are preserved for SIG_DFL and SIG_IGN
dispositions.

Requested and reviewed by:	jilles
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-08-24 16:37:50 +00:00
Jean-Sébastien Pédron
7e1770a7bb vt_vga: Fix the display of the splash screen
MFC after:	1 week
2014-08-24 14:39:33 +00:00
Mateusz Guzik
8cc11167fb Plug a memory leak in case of failed lookups in capability mode.
Put common cnp cleanup into one function and use it for this purpose.

MFC after:	1 week
2014-08-24 12:51:12 +00:00
Jean-Sébastien Pédron
b0187490a8 vt(4): Fix order of arguments (x <-> y) when showing the splash screen
MFC after:	1 week
2014-08-24 09:47:39 +00:00
Mateusz Guzik
ce8daaadbd Use refcount_init in sigacts_alloc.
This change is a no-op, but fixes up an inconsistency introduced with
r268634.

MFC after:	3 days
2014-08-24 09:24:37 +00:00
Jean-Sébastien Pédron
9de6b2c587 vt(4): Remove vd_bitbltchr_t
It's replaced by vd_bitblt_text_t, which gives more context to the
backend and allows it to perform more efficiently when redrawing a given
area.

MFC after:	1 week
2014-08-24 09:22:03 +00:00
Andrey V. Elsukov
69ce0dbce3 The size of the GPT table can not be less than one sector.
Reported by:	rodrigc@
MFC after:	1 week
2014-08-24 09:20:30 +00:00
Mateusz Guzik
abd386bafe Fix getppid for traced processes.
Traced processes always have the tracer set as the parent.
Utilize proc_realparent to obtain the right process when needed.

Reviewed by:	kib
MFC after:	1 week
2014-08-24 09:04:09 +00:00
Mateusz Guzik
a661bebe26 Properly reparent traced processes when the tracer dies.
Previously they were uncoditionally reparented to init. In effect
it was possible that tracee was never returned to original parent.

Reviewed by:	kib
MFC after:	1 week
2014-08-24 09:02:16 +00:00
Peter Grehan
7f21538b6e Change __inline style to be consistent with FreeBSD usage,
and also fix gcc build (on STABLE, when MFCd).

PR:	192880
Reviewed by:	neel
Reported by:	ngie
MFC after:	1 day
2014-08-24 02:07:34 +00:00
Neel Natu
8bd3845d3c Add "hw.vmm.topology.threads_per_core" and "hw.vmm.topology.cores_per_package"
tunables to modify the default cpu topology advertised by bhyve.

Also add a tunable "hw.vmm.topology.cpuid_leaf_b" to disable the CPUID
leaf 0xb. This is intended for testing guest behavior when it falls back
on using CPUID leaf 0x4 to deduce CPU topology.

The default behavior is to advertise each vcpu as a core in a separate soket.
2014-08-24 01:10:06 +00:00
Neel Natu
534dc967d7 Fix a bug in the emulation of CPUID leaf 0x4 where bhyve was claiming that
the vcpu had no caches at all. This causes problems when executing applications
in the guest compiled with the Intel compiler.

Submitted by:	Mark Hill (mark.hill@tidalscale.com)
2014-08-23 22:44:31 +00:00
Neel Natu
7a244722d1 Return the spurious interrupt vector (IRQ7 or IRQ15) if the atpic cannot
find any unmasked pin with an interrupt asserted.

Reviewed by:	tychon
CR:		https://reviews.freebsd.org/D669
MFC after:	1 week
2014-08-23 21:16:26 +00:00
Jean-Sébastien Pédron
631bb572ba vt(4): Add vd_bitblt_bmp_t callback
The code was already there in all backends, we just expose it. This is
used to display the splash screen.

MFC after:	1 week
2014-08-23 20:35:33 +00:00
Adrian Chadd
062cf7d90a Shut down RX before TX - in theory, this should make the chip less likely
to get upset.

The Qualcomm Atheros reference design code goes through significant
hacks to shut down RX before TX.  It doesn't even try do do it in the
driver - it actually makes the DMA stop routines in the HAL shut down
RX before shutting down TX.

So, to make this work for chips that aren't the AR9380 and later, do
it in the driver.  Shuffle the TX stop/drain HAL calls to be called
*after* the RX stop HAL call.

Tested:

* AR5413 (STA)
* AR5212 (STA)
* AR5416 (STA)
* AR9380 (STA)
* AR9331 (AP)
* AR9341 (AP)

TODO:

* test ar92xx series NIC and the AR5210/AR5211, in case there's something
  even odder about those.
2014-08-23 18:55:51 +00:00
Konstantin Belousov
8158a32900 For CPUs which do hardware cache line unaliasing, use direct map to
access sfbufs.

Suggested and reviewed by:	alc
Tested by:	Michael Moll <kvedulv@kvedulv.de>
Sponsored by:	The FreeBSD Foundation
2014-08-23 18:11:54 +00:00
Alexander V. Chernikov
e86bb35d63 Whitespace/style changes merged from projects/ipfw. 2014-08-23 17:57:06 +00:00