Commit Graph

14634 Commits

Author SHA1 Message Date
Hans Petter Selasky
0b30fcb60d Add check for "hw.usb.no_pf" sysctl value.
Submitted by:	Warren Block <wblock@wonkity.com>
MFC after:	1 week
2014-01-21 08:24:12 +00:00
Baptiste Daroussin
a351c93d95 Implicit include of sys/queue.h instead of relying on gelf.h/libelf.h to bring it
Newer version of gelf.h and libelf.h does not include sys/queue.h anymore

Submitted by:	kaiw
MFC after:	3 days
2014-01-20 22:54:11 +00:00
John Baldwin
84b755dfe5 Add support for displaying VPD for PCI devices via pciconf.
- Store the length of each read-only VPD value since not all values are
  guaranteed to be ASCII values (though most are).
- Add a new pciio ioctl to fetch VPD for a single PCI device.  The values
  are returned as a list of variable length records, one for the device
  name and each keyword.
- Add a new -V flag to pciconf's list mode which displays VPD data for
  each device.

MFC after:	1 week
2014-01-20 20:56:09 +00:00
John Baldwin
c9341dd343 - Allow PCI devices that are attached to a driver to be identified by their
device name instead of just the selector.
- Accept an optional device argument to -l to restrict the output to only
  listing details about a single device.  This is mostly useful in
  conjunction with other flags like -e or -c to allow a user to query
  details about a single device.

MFC after:	1 week
2014-01-20 15:51:02 +00:00
Devin Teske
13fba447b4 Dummy commit (whitespace changes and style nits) to show previous commit
(SVN r260866) was [in-part] Submitted-by: Christoph Mallon ...
<christoph.mallon@gmx.de>

MFC After:	3 days
X-MFC-With:	r260866
2014-01-20 03:39:08 +00:00
Devin Teske
3405870c3d Dummy commit (s/__num/__number/) in f_expand_number() to describe that the
previous commit here (SVN r260894) was [in-part] from Submitted-by:
Christoph Mallon <christoph.mallon@gmx.de>

MFC after: 3 days
2014-01-20 03:31:16 +00:00
Devin Teske
ae978c3682 Optimize f_expand_number(), improving performance.
MFC After:	3 days
2014-01-19 21:02:24 +00:00
Devin Teske
e06674ffd2 Fix a bad comparison operator (s/==/=/), and address a use-case issue where-
in the one-line comment associated with the dumpdev setting was not present
for the case where the user deselects the dumpdev service (restoring pre-
r256348 behaviour.

MFC After:	3 days
2014-01-18 22:33:49 +00:00
Neel Natu
27ff748ea1 Fix amd64 build breakage caused by r260532.
Submitted by:	Marcus Karlsson (mk@acc.umu.se)
Pointy hat to:	me
2014-01-11 17:37:53 +00:00
Peter Grehan
d68f0bd618 Fix issue with the virtio descriptor region being truncated
if it was above 4GB. This was seen with CentOS 6.5 guests with
large RAM, since the block drivers are loaded late in the
boot sequence and end up allocating descriptor memory from
high addresses.

Reported by:	Michael Dexter
MFC after:	3 days
2014-01-09 07:17:21 +00:00
Remko Lodder
a8be8e5ee3 virtio-block does not exist, the correct name is virtio-blk.
PR:		185573
Submitted by:	Allan Jude
Facilitated by:	Snow B.V.
MFC after:	3 days
2014-01-08 08:37:30 +00:00
Dimitry Andric
4abd7edcbd Split the last gcc-specific flags off into CFLAGS.gcc. This also
removes the need to use -Qunused-arguments for clang throughout the
tree.

MFC after:	3 days
2014-01-05 21:03:49 +00:00
Gavin Atkinson
093b9154fd Allow bsdinstall to use WPA-Enterprise networks when installing. This
only allows basic username/password config, and does not provide the
ability to set any of the other WPA options.  Regardless, this is
generally sufficient to associate.

Perhaps in the future this could allow full configuring (e.g. being able
to set "anonymous identity", and perhaps some of the more obscure WPA
options), though perhaps that will better belong in bsdconfig when that
grows wlan config ability.

MFC after:	1 week
2014-01-04 17:09:41 +00:00
Gavin Atkinson
ebffa06008 Lower the priority of the "connect to any open wireless network" network
description, so guaranteeing that any other defined network will be tried
first.

MFC after:	1 week
2014-01-04 16:44:05 +00:00
Gavin Atkinson
f051e63a59 Remove what appears to be a stray debugging printf.
MFC after:	1 week
2014-01-04 16:41:43 +00:00
Xin LI
146ff0f40f Make a copy instead using constant string directly when assigning to char *.
While I'm there also remove a few prototypes that are unused.
2014-01-04 01:12:28 +00:00
Xin LI
29df5733c2 Use prototype. 2014-01-04 01:08:10 +00:00
Peter Grehan
b1843e712e Cosmetic change - switch over to vertical SRCS to make it
easier to keep files in alpha order.

Reviewed by:	neel
2014-01-03 19:31:40 +00:00
John Baldwin
e6c8bc291a Rework the DSDT generation code a bit to generate more accurate info about
LPC devices.  Among other things, the LPC serial ports now appear as
ACPI devices.
- Move the info for the top-level PCI bus into the PCI emulation code and
  add ResourceProducer entries for the memory ranges decoded by the bus
  for memory BARs.
- Add a framework to allow each PCI emulation driver to optionally write
  an entry into the DSDT under the \_SB_.PCI0 namespace.  The LPC driver
  uses this to write a node for the LPC bus (\_SB_.PCI0.ISA).
- Add a linker set to allow any LPC devices to write entries into the
  DSDT below the LPC node.
- Move the existing DSDT block for the RTC to the RTC driver.
- Add DSDT nodes for the AT PIC, the 8254 ISA timer, and the LPC UART
  devices.
- Add a "SuperIO" device under the LPC node to claim "system resources"
  aling with a linker set to allow various drivers to add IO or memory
  ranges that should be claimed as a system resource.
- Add system resource entries for the extended RTC IO range, the registers
  used for ACPI power management, the ELCR, PCI interrupt routing register,
  and post data register.
- Add various helper routines for generating DSDT entries.

Reviewed by:	neel (earlier version)
2014-01-02 21:26:59 +00:00
Neel Natu
0492757c70 Restructure the VMX code to enter and exit the guest. In large part this change
hides the setjmp/longjmp semantics of VM enter/exit. vmx_enter_guest() is used
to enter guest context and vmx_exit_guest() is used to transition back into
host context.

Fix a longstanding race where a vcpu interrupt notification might be ignored
if it happens after vmx_inject_interrupts() but before host interrupts are
disabled in vmx_resume/vmx_launch. We now called vmx_inject_interrupts() with
host interrupts disabled to prevent this.

Suggested by:	grehan@
2014-01-01 21:17:08 +00:00
Mikolaj Golub
bcfa7a8677 Add mibs for hastd(1) queue stats.
MFC after:	1 week
2013-12-29 19:02:33 +00:00
Marius Strobl
516e016844 Record the IEEE P1282 Rock Ridge version 1.12 POSIX File Serial Number,
i. e. the POSIX:5.6.1 st_ino field, which can be used to detect hard links
in the file system. This is also the default in mkisofs(8) and according to
its man page, no system only being able to cope with Rock Ridge version 1.10
is known to exist.

PR:		185138
Submitted by:	Kurt Lidl
MFC after:	1 week
2013-12-29 16:43:35 +00:00
John Baldwin
058e24d34b Extend the ACPI power management support to wire a virtual power button up
to SIGTERM when ACPI is enabled.  Sending SIGTERM to the hypervisor when an
ACPI-aware OS is running will now trigger a soft-off allowing for a graceful
shutdown of the guest.
- Move constants for ACPI-related registers to acpi.h.
- Implement an SMI_CMD register with commands to enable and disable ACPI.
  Currently the only change when ACPI is enabled is to enable the virtual
  power button via SIGTERM.
- Implement a fixed-feature power button when ACPI is enabled by asserting
  PWRBTN_STS in PM1_EVT when SIGTERM is received.
- Add support for EVFILT_SIGNAL events to mevent.
- Implement support for the ACPI system command interrupt (SCI) and assert
  it when needed based on the values in PM1_EVT.  Mark the SCI as active-low
  and level triggered in the MADT and MP Table.
- Mark PCI interrupts in the MP Table as active-low in addition to level
  triggered.

Reviewed by:	neel
2013-12-28 04:01:05 +00:00
John Baldwin
cf952fe841 Use pthread_once() to replace a static integer initted flag.
Reviewed by:	neel
2013-12-28 03:21:15 +00:00
Sergey Kandaurov
16aaaa690f Do not truncate the `command'' column in `ps'' output.
Reviewed by:	jhb
MFC after:	1 week
2013-12-25 15:23:01 +00:00
Gleb Smirnoff
729c09bf00 We have in base iconv.
PR:		185135
Submitted by:	Lars Engels <lars 0x20.net>
2013-12-25 01:20:14 +00:00
John Baldwin
6450da0774 Support soft power-off via the ACPI S5 state for bhyve guests.
- Implement the PM1_EVT and PM1_CTL registers required by ACPI.
  The PM1_EVT register is mostly a dummy as bhyve doesn't support any
  of the hardware-initiated events.  The only bit of PM1_CNT that is
  implemented are the sleep request bits (SPL_EN and SLP_TYP) which
  request a graceful power off for S5.  In particular, for S5, bhyve
  exits with a non-zero value which terminates the loop in vmrun.sh.
- Emulate the Reset Control register at I/O port 0xcf9 and advertise
  it as the reset register via ACPI.
- Advertise an _S5 package.
- Extend the in/out interface to allow an in/out handler to request
  that the hypervisor trigger a reset or power-off.
- While here, note that all vCPUs in a guest support C1 ("hlt").

Reviewed by:	neel (earlier version)
2013-12-24 16:14:19 +00:00
John Baldwin
330baf58c6 Extend the support for local interrupts on the local APIC:
- Add a generic routine to trigger an LVT interrupt that supports both
  fixed and NMI delivery modes.
- Add an ioctl and bhyvectl command to trigger local interrupts inside a
  guest.  In particular, a global NMI similar to that raised by SERR# or
  PERR# can be simulated by asserting LINT1 on all vCPUs.
- Extend the LVT table in the vCPU local APIC to support CMCI.
- Flesh out the local APIC error reporting a bit to cache errors and
  report them via ESR when ESR is written to.  Add support for asserting
  the error LVT when an error occurs.  Raise illegal vector errors when
  attempting to signal an invalid vector for an interrupt or when sending
  an IPI.
- Ignore writes to reserved bits in LVT entries.
- Export table entries the MADT and MP Table advertising the stock x86
  config of LINT0 set to ExtInt and LINT1 wired to NMI.

Reviewed by:	neel (earlier version)
2013-12-23 19:29:07 +00:00
Baptiste Daroussin
1efc897026 Fix yet another typo
Reported by:	kib
2013-12-23 17:47:04 +00:00
Baptiste Daroussin
e9d9ee5218 Fix typos
Reported by:	bryanv
2013-12-23 17:26:56 +00:00
Baptiste Daroussin
575c4095bf Do not print a question in non-interractive mode but explain why boostrapping
has failed and how to allow it to happen

Reported by:	jmmv
2013-12-23 17:16:44 +00:00
Joel Dahl
6081b93c89 mdoc: nuke whitespace. 2013-12-23 15:00:15 +00:00
Neel Natu
f80330a820 Add a parameter to 'vcpu_set_state()' to enforce that the vcpu is in the IDLE
state before the requested state transition. This guarantees that there is
exactly one ioctl() operating on a vcpu at any point in time and prevents
unintended state transitions.

More details available here:
http://lists.freebsd.org/pipermail/freebsd-virtualization/2013-December/001825.html

Reviewed by:	grehan
Reported by:	Markiyan Kushnir (markiyan.kushnir at gmail.com)
MFC after:	3 days
2013-12-22 20:29:59 +00:00
Devin Teske
a36511c287 Move the installer's keymap solution introduced by SVN r259468. The new
location of /etc/rc.local on the install media is more appropriate as it
knows serial vs. non-serial and can also do the change earlier (so that
even the initial Install dialog can benefit from the change).

MFC after:	3 days
2013-12-21 16:43:40 +00:00
Neel Natu
851d84f1b5 Add an option to ignore accesses by the guest to unimplemented MSRs.
Also, ignore a couple of SandyBridge uncore PMC MSRs that Centos 6.4 writes
to during boot.

Reviewed by:	grehan
2013-12-19 22:27:28 +00:00
Devin Teske
6311cc9efe When using a bootpool, set the cachefile property so that it gets
imported automatically upon reboot to the newly installed system.

MFC after: 1 day
2013-12-19 06:43:52 +00:00
Devin Teske
4b4b90d5a8 Fix a regression that occurred with SVN revisions 259474 and 259476 where
installation to 3-4+ (depending on vdev type) vdevs would result in odd
error messages where the zpool `create' command appeared to repeat itself
(an artifact of printf when you supply too many arguments -- caused by
neglecting to properly quote the multi-word expansion of $*vdevs when
creating the pool(s)). Example error below (taken from bsdinstall_log):

DEBUG: zfs_create_boot: Creating root pool...
DEBUG: zfs_create_boot: zpool create -o altroot=/mnt -m none -f "zroot" \
ada0p3.nop ada1p3.nopzpool create ada2p3.nop "ada3p3.nop"
DEBUG: zfs_create_boot: retval=1 <output below>
cannot open 'ada1p3.nopzpool': no such GEOM provider
2013-12-19 06:41:30 +00:00
Devin Teske
2d5cf580aa In bsdinstall_log, it's rather confusing to see the following sequence:
DEBUG: Running installation step: hostname
  rm: /tmp/bsdinstall_etc/fstab: No such file or directory

The two lines are unrelated, and the rm is spurious. Let's add `-f' to
that rm(1) so it doesn't confuse us when debugging an install.

MFC after:	3 days
2013-12-18 21:16:57 +00:00
Devin Teske
31a0cf130a Fix "[: -eq: argument expected" error introduced by SVN r256343. The code
should not have used DIALOG_CANCEL because dialog.subr wasn't included to
define it. The effect of the error was that you could not cancel the
partition dialog. Discovered by checking bsdinstall_log for something else.

MFC after:	3 days
2013-12-18 21:13:50 +00:00
Neel Natu
55888cfaa2 Rename the ambiguously named 'vm_setup_msi()' and 'vm_setup_msix()' to
'vm_setup_pptdev_msi()' and 'vm_setup_pptdev_msix()' respectively.

It should now be clear that these functions operate on passthru devices.
2013-12-18 03:58:51 +00:00
Neel Natu
4f8be175d5 Add an API to deliver message signalled interrupts to vcpus. This allows
callers treat the MSI 'addr' and 'data' fields as opaque and also lets
bhyve implement multiple destination modes: physical, flat and clustered.

Submitted by:	Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
Reviewed by:	grehan@
2013-12-16 19:59:31 +00:00
Devin Teske
926ec73fe2 Auto-enable 4k sector alignment when disk encryption is requested (it is
required in such a case). But don't prevent the user from pointing the
gun at his/her foot -- you can disable 4k alignment after enabling geli).

MFC after:	3 days
2013-12-16 19:54:55 +00:00
Devin Teske
cf9c3e5697 Fix a long-standing edge-case that would result in a ghosted `zroot' pool
and subsequent headaches caused by multiple pools with the same name.
Specifically, blast away any labels on the designated swap partition.
Problem was when you install to a given layout *with* swap and then turn
around and re-install the same layout *without* swap (we weren't doing a
labelclear for the swap device, so would end up with an "UNAVAIL" status
zroot pool that may only exist in the pool cache).

MFC after:	3 days
2013-12-16 19:51:11 +00:00
Devin Teske
ee482f2c28 Add kern.geom.label.disk_ident.enable="0" to loader.conf(5).
Discussed on:	-current, -stable
MFC after:	3 days
2013-12-16 19:47:04 +00:00
Devin Teske
7a434c5cc7 De-uglify the geli(8)-setup infobox by adding a newline.
MFC after:	3 days
2013-12-16 19:44:45 +00:00
Devin Teske
ca2d97c2c8 fletcher4 is currently the default.
Discussed on:	-current
MFC after:	3 days
2013-12-16 19:43:04 +00:00
Devin Teske
7cae6aab5b Improve default ZFS disk layout (tested):
+ For GPT, always provision zfs# partition after swap [for resizability]
+ For MBR, always use a boot pool to relialy place root vdevs at EOD
NB: Fixes edge-cases where MBR combination failed boot (e.g. swap-less)
+ Generalize boot pool logic so it can be used for any scheme (namely MBR)
+ Update existing comments and some whitespace fixes
+ Change some variable names to make reading/debugging the code easier
  in zfs_create_boot() (namely prepend zroot_ or bootpool_ to property)
+ Because zroot vdevs are at EOD, no longer need to calculate partsize
  (vdev consumes remaining space after allocating swap)
+ Optimize processing of disks -- no reason to loop over the disks 3-4
  separate times when we can logically use a single loop to do everything

Discussed on:	-stable
MFC after:	3 days
2013-12-16 19:37:15 +00:00
Devin Teske
a622223f01 Bug-fixes and debugging improvments:
+ De-obfuscate debugging to show actual values
+ Change graid(8) syntax; s/destroy/delete/ [destroy is not invalid syntax]
+ Log commands that were previously quiet
+ Added some new comemnts and updated some existing ones
+ Add missing local for `disk' used in zfs_create_boot()
+ Use $disks instead of multiply-expanding $* in zfs_create_boot()
+ Pedantically unset variable holding geli(8) passphrase after use
+ Pedantically add double-quotes around zpool names and zfs datasets
+ Fix quotation expansion for zpool_cache entries of loader.conf(5)
+ Some limited whitespace changes

MFC after:	3 days
2013-12-16 18:53:09 +00:00
Devin Teske
30c8ebe9b7 Accept NULL input as also meaning zero swap.
MFC after:	3 days
2013-12-16 17:11:09 +00:00
Devin Teske
a6c8532c17 As per discussions on -current, re-add /var/mail (removed in r257842) but
this time with atime=on in support of various software that requires it.

Discussed on:	-current
MFC after:	3 days
2013-12-16 17:03:44 +00:00