summaryrefslogtreecommitdiffstats
path: root/usr.sbin
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo.trasz2013-11-141-2/+2
| | | | | Approved by: re (gjb) Sponsored by: The FreeBSD Foundation
* Merge r257945 from head:glebius2013-11-141-2/+2
| | | | | | Do not use just freed memory. Approved by: re (kib)
* Merge r257888, r258049 from head:glebius2013-11-141-5/+0
| | | | | | | | - Use system libiconv, instead of trying to dlopen() it. - Just disable recoding support in libsmb if built WITHOUT_ICONV. PR: 183153 Approved by: re (kib)
* MFC r257749:gjb2013-11-091-2/+9
| | | | | | | | | Switch to using pkg(8) for the doc install in bsdinstall(8). This also bootstraps the system with pkg(8) for future use. Approved by: re (delphij) PR: 183488 Sponsored by: The FreeBSD Foundation
* MFC r257668:bdrewery2013-11-071-2/+2
| | | | | | | Use proper capitalization for FreeBSD.org Approved by: bapt Approved by: re (gjb)
* MFC r257505:bdrewery2013-11-042-23/+61
| | | | | | | | | | | | | Add -f support to 'pkg bootstrap' and 'pkg add' to force installation of pkg(8) even if already installed. This is useful if you somehow messup pkg(8) and need to reinstall from remote with it already being registered in the pkg(8) /var/db/pkg database. Also add some sanity checks to 'pkg add'. Approved by: bapt Approved by: re (glebius)
* MFC r257378,r257400,r257402,r257440:bdrewery2013-11-032-1/+263
| | | | | | | Add a pkg(7) manpage for bootstrap Approved by: bapt Approved by: re (gjb)
* MFC r257377:bdrewery2013-11-031-0/+9
| | | | | | | | Add a 'pkg bootstrap' command which will bootstrap pkg(8) without forwarding any command to it after installation. Approved by: bapt Approved by: re (gjb)
* MFC r257379:trasz2013-11-022-39/+39
| | | | | | | | | | | | | | | | | Rename '-h' option to '-p', and use "portal" instead of "host" or "address", in order to be consistent with iSCSI terminology. Besides, calling the option '-h' was just wrong. This changes usage for newly added iscsictl(8), and two newly added subcommands to ctladm(8). This breaks POLA between CURRENT and 10, but since 10.0 has not been released yet, it's still ok to do. MFC r257380: Bump .Dd after r257379. Approved by: re (glebius) Sponsored by: The FreeBSD Foundation
* MFC r256540, r256544:gjb2013-11-011-1/+9
| | | | | | | | | | | | r256540 (dteske): Add loader.conf(5) entries to import bootpool after boot when using full-disk encryption and ZFS. r256544 (dteske): Fix loader.conf(5) entries from r256540. Approved by: re (hrs) Sponsored by: The FreeBSD Foundation
* MFC r256865brooks2013-10-314-212/+0
| | | | | | | | | Remove the isf(4) driver. It was created by accident and is subset of the cfi(4) driver. It remained in the tree longer than would be ideal due to the time required to bring cfi(4) to feature parity. Sponsored by: DARPA/AFRL Approved by: re (gjb)
* MFC r257092grehan2013-10-301-31/+85
| | | | | | | | | | Fix bug in the ioapic emulation for level-triggered interrupts, where a pin assertion while a source was masked would result in the interrupt being lost, with the symptom being a console hang. The condition is now recorded, and the interrupt generated when the source is unmasked. Approved by: re (glebius)
* MFC r257293.neel2013-10-3013-596/+1103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for PCI-to-ISA LPC bridge emulation. If the LPC bus is attached to a virtual machine then we implicitly create COM1 and COM2 ISA devices. Prior to this change the only way of attaching a COM port to the virtual machine was by presenting it as a PCI device that is mapped at the legacy I/O address 0x3F8 or 0x2F8. There were some issues with the original approach: - It did not work at all with UEFI because UEFI will reprogram the PCI device BARs and remap the COM1/COM2 ports at non-legacy addresses. - OpenBSD GENERIC kernel does not create a /dev/console because it expects the uart device at the legacy 0x3F8/0x2F8 address to be an ISA device. - It was functional with a FreeBSD guest but caused the console to appear on /dev/ttyu2 which was not intuitive. The uart emulation is now independent of the bus on which it resides. Thus it is possible to have uart devices on the PCI bus in addition to the legacy COM1/COM2 devices behind the LPC bus. The command line option to attach ISA COM1/COM2 ports to a virtual machine is "-s <bus>,lpc -l com1,stdio". The command line option to create a PCI-attached uart device is: "-s <bus>,uart[,stdio]" The command line option to create PCI-attached COM1/COM2 device is: "-S <bus>,uart[,stdio]". This style of creating COM ports is deprecated. Approved by: re (glebius)
* MFC: r256770,r257142,r257145,r257146,r257147,r257148,bdrewery2013-10-294-89/+788
| | | | | | | | | | | | | | | | | | | | | r257149,r257150,r257158,r257159,r257164,r257168, r257193 - Support checking signature for pkg bootstrap from remote and for 'pkg add ./pkg.txz' - Be verbose on where pkg is being bootstrapped from. - Add support for reading configuration files from /etc/pkg. For now only /etc/pkg/FreeBSD.conf is supported. - Add test package signing key fingerprint into /etc/keys/pkg/trusted. - Disable fingerprint checking by default for now as the official packages are not yet signed. Approved by: bapt Approved by: re (glebius)
* MFC r257051:bdrewery2013-10-293-1/+9
| | | | | | | | | | | Add support for using "pkg+http://" for the PACKAGESITE. pkg 1.2 is adding this support as well. This should help lessen the confusion on why the default SRV PACKAGESITE does not load in a browser. Approved by: bapt Approved by: re (glebius)
* MFC: r256968, r256971, r256978bapt2013-10-293-3/+108
| | | | | | | | | | | | Improve SRV records support for the pkg(8) bootstrap: - order srv records by priorities - for all entries of the same priority, order randomly respect the weight - select the port where to fetch from respect the port provided in the SRV record Allow to bootstrap by doing pkg add ./a/path/to/a/pkg_package.txz Approved by: re (glebius)
* MFC r256646, r256767, r257038:cperciva2013-10-261-8/+25
| | | | | | | | | | | | | | | | When installing updates, install new directories first and remove old directories last. Allow ~ in file names so libtool droppings in contrib don't break updates. It has happened twice now, and is likely to happen again. Be more selective when filtering for lib*.so.N files. These are deleted at the end of the upgrade process, after warning users to upgrade any 3rd party software (e.g., from the ports tree) which might link to the libraries being removed. Approved by: re (gjb) Errata Notice: FreeBSD-EN-13:04.freebsd-update
* MFC r256926, r257005grehan2013-10-252-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | r256926 Fix AHCI ATAPI emulation when backed with /dev/cd0 - remove assumption that the backing file/device had 512-byte sectors - fix incorrect iovec size variable that would result in a buffer overrun when an o/s issued an i/o request with more s/g elements than the blockif api r257005 Export the block size capability to guests. - Use #defines for capability bits - Export the VTBLK_F_BLK_SIZE capability - Fix bug in calculating capacity: it is in 512-byte units, not the underlying sector size This allows virtio-blk to have backing devices with non 512-byte sector sizes e.g. /dev/cd0, and 4K-block harddrives. Approved by: re (glebius)
* MFC r256450:bdrewery2013-10-232-3/+6
| | | | | | | | Rename libbsdyml to libyaml, make private, and bump SHLIB_MAJOR to 1.0 Approved by: bapt Approved by: re (glebius)
* MFC r256645.neel2013-10-224-50/+49
| | | | | | | | | | | | | | Add a new capability, VM_CAP_ENABLE_INVPCID, that can be enabled to expose 'invpcid' instruction to the guest. Currently bhyve will try to enable this capability unconditionally if it is available. Consolidate code in bhyve to set the capabilities so it is no longer duplicated in BSP and AP bringup. Add a sysctl 'vm.pmap.invpcid_works' to display whether the 'invpcid' instruction is available. Approved by: re (hrs)
* MFC r256709:grehan2013-10-187-147/+60
| | | | | | | | | | | Eliminate unconditional debug printfs. Linux writes to these nominally read-only registers, so avoid having bhyve write warning messages to stdout when the reg writes can be safely ignored. Change the WPRINTF to DPRINTF which is conditional. Approved by: re (delphij)
* MFC r256709:grehan2013-10-181-1/+1
| | | | | | | | | | | Eliminate unconditional debug printfs. Linux writes to these nominally read-only registers, so avoid having bhyve write warning messages to stdout when the reg writes can be safely ignored. Change the WPRINTF to DPRINTF which is conditional. Approved by: re (gjb)
* MFC r256489:dteske2013-10-183-0/+8
| | | | | | | | | Add executable bit to docsinstall [old] and entropy [new] scripts. MFC r256541: Document BSDINSTALL_TMPBOOT environment variable introduced by SVN r256343. Approved by: re (gjb)
* MFC r256391:dteske2013-10-121-24/+34
| | | | | | Fix signed integer overflow detection in f_expand_number() of strings.subr. Approved by: re (glebius)
* MFC r256389grehan2013-10-121-5/+47
| | | | | | | | | | | | Implement the virtio block 'get-ident' operation. This eliminates the annoying verbose boot error of the form g_handleattr: vtbd0 bio_length 24 len 28 -> EFAULT The ident returned by bhyve is a text string 'BHYVE-XXXX-XXXX', where the X's are the first bytes of the md5 hash of the backing filename. Approved by: re (gjb)
* MFC 256385:hrs2013-10-125-6/+51
| | | | | | | | | | | - Add mount.fdescfs parameter to jail(8). This is similar to mount.devfs but mounts fdescfs. The mount happens just after mount.devfs. - rc.d/jail now displays whole error message from jail(8) when a jail fails to start. Approved by: re (gjb)
* MFC revisions 256321-256323,256331,256333,256335,256343:dteske2013-10-1115-53/+1814
| | | | | | | | | | | | | | | | | | | | | | | | Bring in a new zfsboot auto script for performing automatic setup of a boot pool (optionally encrypted) with many other options, validations, features. Originally submitted by Allan Jude; modified in collaboration. MFC revisions 256325,256330,256345: Rewrite the keymap selection menu to display keymaps and provide a test mechanism. Test mechanism originally submitted by Warren Block; modified. MFC r256347: Prominently display "Wireless" for each wireless network interface. Part of PR bin/161547; submitted by Warren Block; slightly modified. MFC r256348: Remove the dumpdev configuration dialog, merge it into the regular services configuration and enable it by default. Originally submitted by Allan Jude; slightly modified. PR: bin/161547 Submitted by: Allan Jude, Warren Block <wblock@wonkity.com> In collaboration with: Allan Jude <freebsd@allanjude.com> Approved by: re (glebius)
* MFH (r256338): store some entropy after installationdes2013-10-116-4/+43
| | | | Approved by: re (gjb)
* - Update rc.d/jail to use a jail(8) configuration file instead ofhrs2013-10-101-4/+6
| | | | | | | | | | | | command line options. The "jail_<jname>_*" rc.conf(5) variables for per-jail configuration are automatically converted to /var/run/jail.<jname>.conf before the jail(8) utility is invoked. This is transparently backward compatible. - Fix a minor bug in jail(8) which prevented it from returning false when jail -r failed. Approved by: re (glebius)
* Allow a 4-byte write to PCI config space to overlapgrehan2013-10-091-3/+12
| | | | | | | | | | | | the 2 read-only bytes at the start of a PCI capability. This is the sequence that OpenBSD uses when enabling MSI interrupts, and works fine on real h/w. In bhyve, convert the 4 byte write to a 2-byte write to the r/w area past the first 2 r/o bytes of a capability. Reviewed by: neel Approved by: re@ (blanket)
* Fix missing .joel2013-10-091-1/+1
| | | | Approved by: re (blanket)
* Plug memory leak.trasz2013-10-091-0/+1
| | | | | | Coverity CID: 1087991 Approved by: re (gjb) Sponsored by: FreeBSD Foundation
* Fix memory overrun.trasz2013-10-091-1/+1
| | | | | | Coverity CID: 1092478 Approved by: re (gjb) Sponsored by: FreeBSD Foundation
* Plug memory leaks.trasz2013-10-091-1/+3
| | | | | | Coverity CID: 1087993, 1087992 Approved by: re (marius) Sponsored by: FreeBSD Foundation
* Fix two off-by-ones.trasz2013-10-091-2/+2
| | | | | | Coverity CID: 1087999, 1011375 Approved by: re (glebius) Sponsored by: FreeBSD Foundation
* Fix incorrect use of sizeof().trasz2013-10-091-1/+1
| | | | | | Coverity CID: 1011303 Approved by: re (glebius) Sponsored by: FreeBSD Foundation
* Fix off-by-one.trasz2013-10-091-1/+1
| | | | | | Coverity CID: 1011375 Approved by: re (glebius) Sponsored by: FreeBSD Foundation
* Introduce centralized [X]dialog(1) exit codes to `dialog.subr' and make-usedteske2013-10-0947-206/+208
| | | | | | | | | | throughout the bsdconfig(8) code. While we're here, add an explicit argument to lvalue-seeking invocations of "return" that previously had no argument. Also, consolidate a single instance of double-newline and remove some comments that are no longer required (given increased readability with new exit codes). Approved by: re (glebius)
* Parse the memory size parameter using expand_number() to allow specifyingneel2013-10-096-14/+37
| | | | | | | | the memory size more intuitively (e.g. 512M, 4G etc). Submitted by: rodrigc Reviewed by: grehan Approved by: re (blanket)
* In usr.sbin/bhyve/pci_ahci.c, fix several gcc warnings of the formdim2013-10-081-11/+11
| | | | | | | | | | | "assignment makes pointer from integer without a cast", by changing the cmd_lst and rbis members of struct ahci_port from integers to pointers. Also surround a pow-of-2 test expression with parentheses to clarify it, and avoid another gcc warning. Approved by: re (glebius) Reviewed by: grehan, mav
* After r256062, the static function fbsdrun_get_next_cpu() indim2013-10-081-11/+0
| | | | | | | usr.sbin/bhyve/bhyverun.c is no longer used, so remove it to silence a gcc warning. Approved by: re (glebius)
* Change the behavior of bhyve such that the gdb listening port is opt-inneel2013-10-082-5/+3
| | | | | | | | | | | | | | | rather than opt-out. Prior to this change if the "-g" option was not specified then a listening socket for tunneling gdb packets would be opened at port 6466. If a second virtual machine is fired up, also without the "-g" option, then that would fail because there is already a listener on port 6466. After this change if a gdb tunnel port needs to be created it needs to be explicitly specified with a "-g <portnum>" command line option. Reviewed by: grehan@ Approved by: re@ (blanket)
* Merge projects/bhyve_npt_pmap into head.neel2013-10-055-29/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the amd64/pmap code aware of nested page table mappings used by bhyve guests. This allows bhyve to associate each guest with its own vmspace and deal with nested page faults in the context of that vmspace. This also enables features like accessed/dirty bit tracking, swapping to disk and transparent superpage promotions of guest memory. Guest vmspace: Each bhyve guest has a unique vmspace to represent the physical memory allocated to the guest. Each memory segment allocated by the guest is mapped into the guest's address space via the 'vmspace->vm_map' and is backed by an object of type OBJT_DEFAULT. pmap types: The amd64/pmap now understands two types of pmaps: PT_X86 and PT_EPT. The PT_X86 pmap type is used by the vmspace associated with the host kernel as well as user processes executing on the host. The PT_EPT pmap is used by the vmspace associated with a bhyve guest. Page Table Entries: The EPT page table entries as mostly similar in functionality to regular page table entries although there are some differences in terms of what bits are used to express that functionality. For e.g. the dirty bit is represented by bit 9 in the nested PTE as opposed to bit 6 in the regular x86 PTE. Therefore the bitmask representing the dirty bit is now computed at runtime based on the type of the pmap. Thus PG_M that was previously a macro now becomes a local variable that is initialized at runtime using 'pmap_modified_bit(pmap)'. An additional wrinkle associated with EPT mappings is that older Intel processors don't have hardware support for tracking accessed/dirty bits in the PTE. This means that the amd64/pmap code needs to emulate these bits to provide proper accounting to the VM subsystem. This is achieved by using the following mapping for EPT entries that need emulation of A/D bits: Bit Position Interpreted By PG_V 52 software (accessed bit emulation handler) PG_RW 53 software (dirty bit emulation handler) PG_A 0 hardware (aka EPT_PG_RD) PG_M 1 hardware (aka EPT_PG_WR) The idea to use the mapping listed above for A/D bit emulation came from Alan Cox (alc@). The final difference with respect to x86 PTEs is that some EPT implementations do not support superpage mappings. This is recorded in the 'pm_flags' field of the pmap. TLB invalidation: The amd64/pmap code has a number of ways to do invalidation of mappings that may be cached in the TLB: single page, multiple pages in a range or the entire TLB. All of these funnel into a single EPT invalidation routine called 'pmap_invalidate_ept()'. This routine bumps up the EPT generation number and sends an IPI to the host cpus that are executing the guest's vcpus. On a subsequent entry into the guest it will detect that the EPT has changed and invalidate the mappings from the TLB. Guest memory access: Since the guest memory is no longer wired we need to hold the host physical page that backs the guest physical page before we can access it. The helper functions 'vm_gpa_hold()/vm_gpa_release()' are available for this purpose. PCI passthru: Guest's with PCI passthru devices will wire the entire guest physical address space. The MMIO BAR associated with the passthru device is backed by a vm_object of type OBJT_SG. An IOMMU domain is created only for guest's that have one or more PCI passthru devices attached to them. Limitations: There isn't a way to map a guest physical page without execute permissions. This is because the amd64/pmap code interprets the guest physical mappings as user mappings since they are numerically below VM_MAXUSER_ADDRESS. Since PG_U shares the same bit position as EPT_PG_EXECUTE all guest mappings become automatically executable. Thanks to Alan Cox and Konstantin Belousov for their rigorous code reviews as well as their support and encouragement. Thanks for John Baldwin for reviewing the use of OBJT_SG as the backing object for pci passthru mmio regions. Special thanks to Peter Holm for testing the patch on short notice. Approved by: re Discussed with: grehan Reviewed by: alc, kib Tested by: pho
* Remove obsolete cmd-line options and code associated withgrehan2013-10-043-154/+28
| | | | | | | | | these. The mux-vcpus option may return at some point, given it's utility in finding bhyve (and FreeBSD) bugs. Approved by: re@ (blanket) Discussed with: neel@
* kldxref: Do not depend on the directory order.jilles2013-10-041-1/+11
| | | | | | | | | | | | | | | | Sort the filenames to get a consistent result between machines of the same architecture. Also, sort FTS_D entries after other entries so kldxref -R works properly in the uncommon case that a directory contains both subdirectories and modules. Previously, this may have happened to work, depending on the order of files in the directory. PR: bin/182098 Submitted by: Derek Schrock (original version) Tested by: Derek Schrock Approved by: re (delphij) MFC after: 1 week
* Hook up the AHCI and blockif code to the build.grehan2013-10-041-2/+2
| | | | Approved by: re@ (blanket)
* Import Zhixiang Yu's GSoC'13 AHCI emulation:grehan2013-10-042-0/+2109
| | | | | | | | | | | | | | | | | https://wiki.freebsd.org/SummerOfCode2013/bhyveAHCI This provides ICH8 SATA disk and ATAPI ports, selectable via the bhyve slot command-line parameter: SATA -s <slot>,ahci-hd,<image-file> ATAPI -s <slot>,ahci-cd,<image-file> Slight modifications by: grehan@ Approved by: re@ (blanket) Obtained from: FreeBSD GSoC'13
* Block-layer backend interface for bhyve block-io device emulations.grehan2013-10-042-0/+490
| | | | Approved by: re@ (blanket)
* Meinberg clocks support was inadvertently removed during the last vendorroberto2013-10-022-2/+2
| | | | | | | | | import. Add it back. PR: bin/182545 Submitted by: Joerg Pulz <Joerg.Pulz@frm2.tum.de> Approved by: re (delphij) MFC after: 1 week
* Sweep man pages replacing ad -> ada.pluknet2013-10-011-4/+4
| | | | | | Approved by: re (blackend) MFC after: 1 week X-MFC note: stable/9 only
OpenPOWER on IntegriCloud