Commit Graph

99528 Commits

Author SHA1 Message Date
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
Alexander Motin
2e7d7bb294 Restore pre-r239157 handling of sched_yield(), when thread time slice was
aborted, allowing other threads to run.  Without this change thread is just
rescheduled again, that was illustrated by provided test tool.

PR:		192926
Submitted by:	eric@vangyzen.net
MFC after:	2 weeks
2014-08-23 17:31:56 +00:00
Jean-Sébastien Pédron
5a7d2743bf ofwfb: Implement vd_bitblt_text_t
MFC after:	1 week
2014-08-23 15:05:11 +00:00
Jean-Sébastien Pédron
54927e051c creator_fb: Implement vd_bitblt_text_t
MFC after:	1 week
2014-08-23 15:04:20 +00:00
Jean-Sébastien Pédron
c285e4a5e9 vt_fb: Implement vd_bitblt_text_t for vt_fb and derivatives
MFC after:	1 week
2014-08-23 15:00:47 +00:00
Jean-Sébastien Pédron
946d0288f2 vt(4): Fix cursor handling in vt_flush()
There were situations where the cursor was not erased/redrawn or its
position was marked as dirty even though it's not displayed. The code is
now more straightforward.

At the same, add a function to determine if the cursor covers a given
area. This is used by backends to know if they need to draw the cursor.

This new function should be paired with a new state in struct vt_device,
called vd_mshown, which indicates if the cursor should be displayed.
This again simplifies vd_bitblt_text_t callback's API.

MFC after:	1 week
2014-08-23 11:46:52 +00:00
Edward Tomasz Napierala
f81018caf2 Autofs softc needs to be global anyway, so don't pass it as a local
variable, and don't store in autofs_mount.  Also rename it from 'sc'
to 'autofs_softc', since it's global and extern.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-23 11:45:14 +00:00
Edward Tomasz Napierala
a32ba4e63e Add comment explaining one of the quirks in autofs.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-23 11:38:31 +00:00
Jean-Sébastien Pédron
835ceac677 vt(4): Fix a crash in vt_mark_mouse_position_as_dirty() when in textmode
In textmode, no font is loaded, thus the page fault in
vt_mark_mouse_position_as_dirty() when it wants the font width/height.

For now, create a fake area for the textmode. This needs to be modified
if vt_vga gains mouse support in textmode.

While here, fix a build failure when SC_NO_CUTPASTE is defined:
vt_mark_mouse_position_as_dirty() must not be included in this case.

MFC after:	1 week
2014-08-23 07:41:08 +00:00
Jean-Sébastien Pédron
81788a2b59 vt_vga: Give only the character part of term_char_t to vga_get_cp437()
This fixes a bug where vga_get_cp437() was called with an invalid
argument. The screen was then filled with '?' instead of the actual
character.

MFC after:	1 week
2014-08-23 07:02:57 +00:00
Alan Cox
b9ce8cc2d7 Relax one of the conditions for mapping a page on the fast path.
Reviewed by:	kib
X-MFC with:	r270011
Sponsored by:	EMC / Isilon Storage Division
2014-08-23 05:24:31 +00:00
Xin LI
090234abd3 Update hptnr(4) driver to version 1.0.1 supplied by the vendor.
v1.0.1 2014-8-19
  * Do not retry the command and reset the disk when failed to enable or
    disable spin up feature.
  * Fix up a bug that disk failed to probe if driver failed to access the
    10th LBA.
  * Fix a bug that request timeout but it has been completed in certain
    cases.
  * Support smartmontool for R750.

Many thanks to HighPoint for continued support of FreeBSD!

MFC after:	3 days
2014-08-23 01:52:43 +00:00
Xin LI
ec1b564650 Instead of using timestamp in the AVL, use the memory address when
comparing.

Illumos issue:
    5095 panic when adding a duplicate dbuf to dn_dbufs

MFC after:	3 days
2014-08-22 23:13:53 +00:00
Xin LI
fa4484104c MFV r270197:
Illumos issue:
    5066 remove support for non-ANSI compilation
    5068 Remove SCCSID() macro from <macros.h>

MFC after:	2 weeks
2014-08-22 22:13:36 +00:00
Mark Johnston
5fc2632281 Add some missing checks for unsupported interfaces (e.g. pflog(4)) when
handling ioctls. While here, remove duplicated checks for a NULL ifp in
in6_control(): this check is already done near the beginning of the
function.

PR:		189117
Reviewed by:	hrs
MFC after:	2 weeks
2014-08-22 19:21:08 +00:00
Xin LI
a7f77a3950 Restore historical behavior of in_control, which, when no matching address
is found, the first usable address is returned for legacy ioctls like
SIOCGIFBRDADDR, SIOCGIFDSTADDR, SIOCGIFNETMASK and SIOCGIFADDR.

While there also fix a subtle issue that a caller from a jail asking for
INADDR_ANY may get the first IP of the host that do not belong to the jail.

Submitted by:	glebius
Differential Revision: https://reviews.freebsd.org/D667
2014-08-22 19:08:12 +00:00
Jack F Vogel
61ae650d55 Update to the Intel Base driver for the Intel XL710 Ethernet Controller Family
- It was decided to change the driver name to if_ixl for FreeBSD
	- This release adds the VF Driver to the tree, it can be built into
	  the kernel or as the if_ixlv module
	- The VF driver is independent for the first time, this will be
	  desireable when full SRIOV capability is added to the OS.
	- Thanks to my new coworker Eric Joyner for his superb work in
	  both the core and vf driver code.

Enjoy everyone!

Submitted by:	jack.vogel@intel.com and eric.joyner@intel.com
MFC after:	3 days (hoping to make 10.1)
2014-08-22 18:59:19 +00:00
Konstantin Belousov
fbb6eca60f In do_lock_pi(), do not override error from umtxq_sleep_pi() when
doing suspend check.  This restores the pre-r251684 behaviour, to
retry once after the signal is detected.

PR:	kern/192918
Submitted by:	Elliott Rabe, Dell Inc., Eric van Gyzen <eric@vangyzen.net>
Obtained from:	Dell Inc.
MFC after:	1 week
2014-08-22 18:42:14 +00:00
Jean-Sébastien Pédron
1f9c1db5f5 vt(4): Remove "FIXME" about multiple locking of vt_buf in vt_flush()
After some testing, it appears that acquiring the lock once and keeping
it longer is slower than taking it multiple times.

While here, fix a typo in another comment.

MFC after:	1 week
2014-08-22 17:49:24 +00:00
Jean-Sébastien Pédron
82276bbb00 vt(4): Use the actual size of the mouse when marking its position as dirty
This fixes a bug where part of the cursor was not erased.

MFC after:	1 week
2014-08-22 17:09:31 +00:00
Jean-Sébastien Pédron
523473b8f7 vt_vga: Remove a "FIXME" comment; the issue was solved in r270338
MFC after:	1 week
2014-08-22 17:05:41 +00:00
Jean-Sébastien Pédron
15c6d8f590 vt(4): Don't run vt_set_border() and vt_flush() concurrently
In the case of vt_vga, the two concurrent calls were writing to the same
VGA registers, causing incorrect refresh of the screen.

MFC after:	1 week
2014-08-22 16:30:26 +00:00
Roger Pau Monné
1e218ce964 xen: fix incorrectly accounted free
Fix some frees incorrectly assigned to M_XENBUS when the memory is
allocated with M_XENSTORE.

Sponsored by: Citrix Systems R&D
MFC after:	1 week

dev/xen/blkback/blkback.c:
 - Fix incorrect frees.
2014-08-22 15:38:21 +00:00
Jean-Sébastien Pédron
ccd5615a33 vt(4): The offset to center the text area is per-window now
The previous global offset, based on the last loaded font, had no
meaning for other windows. This caused a shifted text area, often partly
out-of-screen.

MFC after:	1 week
2014-08-22 15:36:57 +00:00
Roger Pau Monné
b740f63f23 netback: remove dead code
Remove the xen_net_read_mac function since it's not used anymore.

Sponsored by: Citrix Systems R&D
2014-08-22 15:34:56 +00:00
Jean-Sébastien Pédron
ab06c77688 vt(4): Give the window to vd_bitblt_text_t callback
... instead of both the buffer and the font. Again, this simplifies the
API.

MFC after:	1 week
2014-08-22 15:16:41 +00:00
Roger Pau Monné
1b386f626f netback: fixes for netback
This patch contains the following fixes for netback:
 - Only unbind the evtchn if it has been bound.
 - Set xnb->bridge to NULL after free to prevent double-freeing it.
 - Set the MAC address for the host-facing interface to a dummy value.

Sponsored by: Citrix Systems R&D

dev/xen/netback/netback.c:
 - Prevent trying to unbind if the evtchn has not been bounded.
 - Prevent double-freeing xnb->bridge.
 - Set the MAC address of the host-facing interface to a dummy value,
   so it can work when the interface is added to a bridge.
2014-08-22 15:10:26 +00:00
Roger Pau Monné
cd407ca216 pci: add a new pci_child_added newbus method.
This is needed so when running under Xen the calls to pci_child_added
can be intercepted and a custom Xen method can be used to register
those devices with Xen. This should not include any functional
change, since the Xen implementation will be added in a following
patch and the native implementation is a noop.

Sponsored by: Citrix Systems R&D
Reviewed by: jhb

dev/pci/pci.c:
dev/pci/pci_if.m:
dev/pci/pci_private.h:
dev/pci/pcivar.h:
 - Add the pci_child_added newbus method.
2014-08-22 15:05:51 +00:00
Jean-Sébastien Pédron
3235c9eb55 vt(4): Store cursor bitmap & colors in struct vt_device
This removes the need to specify them to each call to vd_bitblt_text_t
and, therefore, simplifies the API.

MFC after:	1 week
2014-08-22 14:31:53 +00:00
Jean-Sébastien Pédron
e2eb041785 vt(4): Mark new mouse position as dirty only when it's actually displayed
MFC after:	1 week
2014-08-22 13:48:33 +00:00
Warner Losh
e4bed0b403 We should never enter the PROBE_SETAN phase if we're not ATAPI, since
that's ATAPI specific. Instead, skip to PROBE_SET_MULTI instead for
non ATAPI protocols. The prior code incorrectly terminated the probe
with a break, rather than arranging for probedone to get called. This
caused panics or worse on some systems.
2014-08-22 13:15:59 +00:00
Jean-Sébastien Pédron
37fcd2911e vt_vga: Clip the draw area to never draw offscreen
This fixes a bug when two windows use different fonts, but a longer-term
solution is required. The dirty area should be stored as pixels, not
character cells, because such coordinates don't have the same meaning in
all windows, when using different fonts.

MFC after:	1 week
2014-08-22 10:49:51 +00:00
Jean-Sébastien Pédron
bdcaf97c3e vt(4): Add new vd_bitblt_text_t callback, and implement it for vt_vga
Compared to the deprecated vd_bitbltchr_t callback, vd_bitblt_text_t
receives:
    o  the whole text buffer
    o  the dirty area
    o  the mouse cursor (map, position, colors)

This allows the backend to perform optimization on how to draw things.
The goal is to remove vd_bitbltchr_t and vd_putchar_t, once all driver
are converted (only vt_vga is included in this commit).

In vt_vga, this allows to draw the text and the cursor in one pass,
without ever reading from video memory (because it has all the context).
The main benefit is the speed improvement: no more slideshow during
boot!

Other bugs fixed in vt_vga are:
    o  left-most characters are drawn properly (the left-most pixels were
       missing with bold characters and some wide letters such as 'm')
    o  no more black square around the cursor
    o  no cursor flickering when the text is scrolling

There are still many problems to fix: the known issues are marked with
"FIXME" inside the code.

MFC after:	1 week
2014-08-22 08:22:40 +00:00
Konstantin Belousov
350ae56373 Ensure that sigaction flags for signal, which disposition is reset to
ignored or default, are not leaking.  Apparently, there exists code
which relies on SA_SIGINFO not reported for SIG_DFL or SIG_IGN.

In kern_sigaction, ignore flags when resetting.  Encapsulate the flag
and disposition testing into helper sigact_flag_test().

On exec, and when delivering signal with SA_RESETHAND flag set,
signals are reset automatically.  Use new helper sigdflt(), which
removes duplicated code and corrects all flag bits for the signal.

For proc0, set sigintr bit for all ignored signals.  Ignored signals
are consumed in tdsendsignal() and not delivered to the victim thread
at all.

Reported and tested by:	royger
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-08-22 08:19:08 +00:00
Konstantin Belousov
2d86417410 Check the validity of struct sigaction sa_flags value, reject unknown
flags.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-08-22 07:52:47 +00:00
Hiroki Sato
ed063112f4 Fix a panic which occurs in a VIMAGE-enabled kernel after r270158, and
separate socket_hhook_register() part and put it into VNET_SYS{,UN}INIT()
handler.

Discussed with:	marcel
2014-08-22 05:03:30 +00:00
Ian Lepore
1fd407a76c This module requires pci_if.h, add it to the SRCS list.
We haven't noticed that it was missing because eisa has been disabled for
a while in -current, but it became apparent when some parallel-build stuff
was MFC'd to 10-stable and this module failed to build there.
2014-08-21 22:42:02 +00:00
Sean Bruno
5f91863a54 Add the Samsung 843T as a 4k enabled drive
Submitted by:	Jason Wolfe <jason@llnw.com>
MFC after:	2 weeks
Sponsored by:	Limelight Networks
2014-08-21 21:05:58 +00:00
Ed Maste
4d52a0fd97 Rename DT_FEATURE_1 to DT_FEATURE
This provides a minor cleanup in elfdump; there are otherwise no
consumers in the tree.  Old SUN documentation can be found for either
variant, but GNU binutils switched to DT_FEATURE around 2000.

Sponsored by:	The FreeBSD Foundation
2014-08-21 20:55:10 +00:00
Jean-Sébastien Pédron
0c1c6af438 vt_vga: When clearing video memory, don't read from it
The goal is to clear the video memory, in case an application drew to
it. So the content shouldn't be loaded in the latches, it can't be
trusted anyway.

This improves a bit the window switch speed.

MFC after:	1 week
2014-08-21 20:10:05 +00:00
Jean-Sébastien Pédron
02ebdd502d vt(4): Rename the "mouse_cursor" structure to "vt_mouse_cursor"
At the same time, "w" and "h" members are now called "width" and
"height". The goal is to have a more "public" structure, because it will
soon be passed as argument to a new callback, replacing vd_bitbltchr_t.

MFC after:	1 week
2014-08-21 19:42:24 +00:00
Jean-Sébastien Pédron
943c702a1b vt(4): Test if the cursor is shown only once
Later, we just see if the "struct mouse_cursor" pointer is set. This
avoids the need to mess with all the conditions several times; this has
been error prone.

While here, rename the variable "m" to a more meaningful "cursor", like
it's done elsewhere in the code.

MFC after:	1 week
2014-08-21 19:15:22 +00:00
Jean-Sébastien Pédron
c6e1a98786 vt(4): Constify vt_buf argument of vtbuf_iscursor()
MFC after:	1 week
2014-08-21 18:26:32 +00:00
Alexander V. Chernikov
c59adfc6a5 * Add new net/sff8436.h containing constants used to access
QSFP+ data via i2c inteface. These constants has been taken
  from SFF-8436 "QSFP+ 10 Gbs 4X PLUGGABLE TRANSCEIVER" standard
  rev 4.8.
* Add support for printing QSFP+ information from 40G NICs
  such as Chelsio T5.

This commit does not contain ioctl changes necessary for this
functionality work, there will be another commit soon.

Example:
cxl1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=ec07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,.....>
        ether 00:07:43:28:ad:08
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet 40Gbase-LR4 <full-duplex>
        status: active
        plugged: QSFP+ 40GBASE-LR4 (MPO Parallel Optic)
        vendor: OEM PN: OP-QSFP-40G-LR4 SN: 20140318001 DATE: 2014-03-18
        module temperature: 64.06 C voltage: 3.26 Volts
        lane 1: RX: 0.47 mW (-3.21 dBm) TX: 2.78 mW (4.46 dBm)
        lane 2: RX: 0.20 mW (-6.94 dBm) TX: 2.80 mW (4.47 dBm)
        lane 3: RX: 0.18 mW (-7.38 dBm) TX: 2.79 mW (4.47 dBm)
        lane 4: RX: 0.90 mW (-0.45 dBm) TX: 2.80 mW (4.48 dBm)

Tested on:	Chelsio T5
Tested on:	Mellanox/Huawei passive/active cables/transceivers.
MFC after:	2 weeks
Sponsored by:	Yandex LLC
2014-08-21 17:54:42 +00:00