259639 |
20-Dec-2013 |
grehan |
MFStable r259536 MFC r259302,r259413
r259302 bhyve(8) man page
r259413 mdoc: sort SEE ALSO
Approved by: re@ (glebius) |
259496 |
17-Dec-2013 |
grehan |
MFStable-10 r259301
MFC r256657,r257018,r257347,r257423,r257729,r257767, r257933,r258609,r258614,r258668,r258673,r258855
Pull in some minor bugfixes and functionality enhancements from CURRENT. These are candidates to be moved to 10.0-release.
r258855 mdoc: quote string properly.
r258673 Don't create an initial value for the host filesystem of "/".
r258668 Allow bhyve and bhyveload to attach to tty devices.
r258614 The 22-bit Data Byte Count (DBC) field of a Physical Region Descriptor was being read as a 32-bit quantity by the bhyve AHCI driver.
r258609 Fix discrepancy between the IOAPIC ID advertised by firmware tables and the actual value read by the guest.
r257933 Route the legacy timer interrupt (IRQ0) to pin 2 of the IOAPIC.
r257767 Fix an off-by-one error when iterating over the emulated PCI BARs.
r257729 Add the VM name to the process name with setproctitle().
r257423 Make the virtual ioapic available unconditionally in a bhyve virtual machine.
r257347 Update copyright to include the author of the LPC bridge emulation code.
hand-merge r257018 Tidy usage messages for bhyve and bhyveload.
r256657 Add an option to bhyveload(8) that allows setting a loader environment variable from the command line.
Approved by: re@ (gjb) |
259128 |
09-Dec-2013 |
gjb |
Remove svn:mergeinfo from the releng/10.0 branch.
After branch creation from stable/10, the stable/10 branch mergeinfo was moved to the root of the branch.
Since there have not been any merges from stable/10 to releng/10.0 yet, we do not need to track any of the existing mergeinfo here.
Merges to releng/10.0 should now be done to the root of the branch.
For future branches during the release cycle, unless otherwise noted, this change will be done as part of the stable/ and releng/ branch creation.
Discussed with: peter Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
259065 |
07-Dec-2013 |
gjb |
- Copy stable/10 (r259064) to releng/10.0 as part of the 10.0-RELEASE cycle. - Update __FreeBSD_version [1] - Set branch name to -RC1
[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so start releng/10.0 at '100' so the branch is started with a value ending in zero.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
257397 |
30-Oct-2013 |
grehan |
MFC r257092
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)
|
257396 |
30-Oct-2013 |
neel |
MFC r257293.
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)
|
257128 |
25-Oct-2013 |
grehan |
MFC r256926, r257005
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)
|
256869 |
22-Oct-2013 |
neel |
MFC r256645.
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)
|
256755 |
18-Oct-2013 |
grehan |
MFC r256709:
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)
|
256754 |
18-Oct-2013 |
grehan |
MFC r256709:
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)
|
256390 |
12-Oct-2013 |
grehan |
MFC r256389
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)
|
256281 |
10-Oct-2013 |
gjb |
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation
|
256248 |
10-Oct-2013 |
grehan |
Allow a 4-byte write to PCI config space to overlap 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)
|
256176 |
09-Oct-2013 |
neel |
Parse the memory size parameter using expand_number() to allow specifying the memory size more intuitively (e.g. 512M, 4G etc).
Submitted by: rodrigc Reviewed by: grehan Approved by: re (blanket)
|
256164 |
08-Oct-2013 |
dim |
In usr.sbin/bhyve/pci_ahci.c, fix several gcc warnings of the form "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
|
256158 |
08-Oct-2013 |
dim |
After r256062, the static function fbsdrun_get_next_cpu() in usr.sbin/bhyve/bhyverun.c is no longer used, so remove it to silence a gcc warning.
Approved by: re (glebius)
|
256156 |
08-Oct-2013 |
neel |
Change the behavior of bhyve such that the gdb listening port is opt-in 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)
|
256072 |
05-Oct-2013 |
neel |
Merge projects/bhyve_npt_pmap into head.
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
|
256062 |
04-Oct-2013 |
grehan |
Remove obsolete cmd-line options and code associated with 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@
|
256057 |
04-Oct-2013 |
grehan |
Hook up the AHCI and blockif code to the build.
Approved by: re@ (blanket)
|
256056 |
04-Oct-2013 |
grehan |
Import Zhixiang Yu's GSoC'13 AHCI emulation: 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
|
256052 |
04-Oct-2013 |
grehan |
Block-layer backend interface for bhyve block-io device emulations.
Approved by: re@ (blanket)
|
255890 |
26-Sep-2013 |
grehan |
Fix incorrect assertion on the minimum side. ZFS would trigger this.
Reported by: Chris Torek, Allan Jude Approved by: re@ (blanket)
|
255691 |
19-Sep-2013 |
grehan |
Implement support for the interrupt-on-terminal-count and s/w-strobe timer modes. These are commonly used by non-FreeBSD o/s's.
Approved by: re@ (blanket)
|
255690 |
19-Sep-2013 |
grehan |
Add simplistic periodic timer support to mevent using kqueue's timer support. This should be enough for the emulation of h/w periodic timers (and no more) e.g. some of the 8254's more esoteric modes that happen to be used by non-FreeBSD o/s's.
Approved by: re@ (blanket)
|
255689 |
19-Sep-2013 |
grehan |
Allow the alarm hours/mins/seconds registers to be read/written, though without any action. This avoids a hypervisor exit when o/s's access these regs (Linux).
Reviewed by: neel Approved by: re@ (blanket)
|
255688 |
19-Sep-2013 |
grehan |
Use correct offset for the high byte of high memory written to RTC NVRAM.
Submitted by: Bela Lubkin bela dot lubkin at tidalscale dot com Approved by: re@ (blanket)
|
255647 |
17-Sep-2013 |
grehan |
Pass the number of supported vectors to pci_emul_add_msicap() and not the actual PCI BAR number.
Reviewed by: neel Approved by: re@ (blanket)
|
255438 |
10-Sep-2013 |
grehan |
Go way past 11 and bump bhyve's max vCPUs to 16.
This should be sufficient for 10.0 and will do until forthcoming work to avoid limitations in this area is complete.
Thanks to Bela Lubkin at tidalscale for the headsup on the apic/cpu id/io apic ASL parameters that are actually hex values and broke when written as decimal when 11 vCPUs were configured.
Approved by: re@
|
255293 |
06-Sep-2013 |
grehan |
Fix spelling.
|
255292 |
06-Sep-2013 |
grehan |
Allow level-triggered interrupt sources. While this isn't precisely emulated, it is good enough for the single consumer i.e. irq4, the serial port on Linux.
|
254965 |
27-Aug-2013 |
neel |
Allow single byte reads of the emulated MSI-X tables. This is not required by the PCI specification but needed to dump MMIO space from "ddb" in the guest.
|
254948 |
27-Aug-2013 |
grehan |
Fix off-by-1 error in assert.
Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
|
254395 |
16-Aug-2013 |
grehan |
Fix ordering of legacy IRQ reservations.
Submitted by: Jeremiah Lott jlott at averesystems dot com
|
253452 |
18-Jul-2013 |
grehan |
Sanity-check the vm exitcode, and exit the process if it's out-of-bounds or there is no registered handler.
Submitted by: Bela Lubkin bela dot lubkin at tidalscale dot com
|
253440 |
17-Jul-2013 |
grehan |
Major rework of the virtio code. Split out common parts, and modify the net/block devices accordingly.
Submitted by: Chris Torek torek at torek dot net Reviewed by: grehan
|
253181 |
11-Jul-2013 |
grehan |
Implement RTC CMOS nvram. Init some fields that are used by FreeBSD and UEFI. Tested with nvram(4).
Reviewed by: neel
|
252682 |
04-Jul-2013 |
grehan |
Support an optional "mac=" parameter to virtio-net config, to allow users to set the MAC address for a device.
Clean up some obsolete code in pci_virtio_net.c
Allow an error return from a PCI device emulation's init routine to be propagated all the way back to the top-level and result in the process exiting.
Submitted by: Dinakar Medavaram dinnu sun at gmail (original version)
|
252494 |
02-Jul-2013 |
grehan |
Fix up option parsing to allow a colon in the config section. Clean up some other unnecessary code.
Submitted by: Dinakar Medavaram dinnu sun at gmail Reviewed by: neel
|
252336 |
28-Jun-2013 |
grehan |
Allow 8259 registers to be read. This is a transient condition during Linux boot.
Submitted by: tycho nightingale at pluribusnetworks com Reviewed by: neel
|
252331 |
28-Jun-2013 |
grehan |
Allow the PCI config address register to be read. The Linux kernel does this. Also remove an unused header file.
Submitted by: tycho nightingale at pluribusnetworks com Reviewed by: neel
|
250197 |
03-May-2013 |
neel |
Implement the NOTIFY_ON_EMPTY capability in the virtio-net device.
If this capability is negotiated by the guest then the device will generate an interrupt when it runs out of available tx/rx descriptors.
Reviewed by: grehan Obtained from: NetApp
|
250086 |
30-Apr-2013 |
neel |
Reset some more softc state when the guest resets the virtio network device.
Obtained from: NetApp
|
250083 |
30-Apr-2013 |
neel |
Use a separate mutex for the receive path instead of overloading the softc mutex for this purpose.
Reviewed by: grehan
|
250009 |
28-Apr-2013 |
neel |
Get rid of the 'vsc_rxpend' state - it doesn't serve any purpose because we drop any frames that arrive while the device is starved for receive buffers.
This makes the receive path to only execute in context of the receive thread and allows for further simplification.
Reviewed by: grehan
|
249917 |
26-Apr-2013 |
grehan |
Use a thread for the processing of virtio tx descriptors rather than blocking the vCPU thread. This improves bulk data performance by ~30-40% and doesn't harm req/resp time for stock netperf runs.
Future work will use a thread pool rather than a thread per tx queue.
Submitted by: Dinakar Medavaram Reviewed by: neel, grehan Obtained from: NetApp
|
249916 |
26-Apr-2013 |
neel |
Gripe if some <slot,function> tuple is specified more than once instead of silently overwriting the previous assignment.
Gripe if the emulation is not recognized instead of silently ignoring the emulated device.
If an error is detected by pci_parse_slot() then exit from the command line parsing loop in main().
Submitted by (initial version): Chris Torek (chris.torek@gmail.com)
|
249813 |
23-Apr-2013 |
neel |
Teach the virtio block device to deal with direct as well as indirect descriptors. Prior to this change the device would only work with guests that chose to use indirect descriptors.
Modify the device reset callback to actually reset the device state.
Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
|
249572 |
17-Apr-2013 |
neel |
Setup accesses to the memory hole below 4GB to return all 1's on read and consume all writes without any side effects.
Obtained from: NetApp
|
249343 |
10-Apr-2013 |
neel |
Need to call init_mem() to really initialize the MMIO range lookups.
This was working by accident because: - the RB_HEADs were being initialized to zero as part of BSS - the pthread_rwlock functions were implicitly initializing the lock object
Obtained from: NetApp
|
249342 |
10-Apr-2013 |
neel |
Remove obsolete comment about lack of locking for MMIO range lookup.
Pointed out by: Tycho Nightingale (tycho.nightingale@plurisbusnetworks.com)
|
249324 |
10-Apr-2013 |
neel |
Unsynchronized TSCs on the host require special handling in bhyve:
- use clock_gettime(2) as the time base for the emulated ACPI timer instead of directly using rdtsc().
- don't advertise the invariant TSC capability to the guest to discourage it from using the TSC as its time base.
Discussed with: jhb@ (about making 'smp_tsc' a global) Reported by: Dan Mack on freebsd-virtualization@ Obtained from: NetApp
|
249322 |
10-Apr-2013 |
neel |
Change name of variable from 'rwlock' to more descriptive 'mmio_rwlock'
Requested by: grehan Obtained from: NetApp
|
249321 |
10-Apr-2013 |
neel |
Improve PCI BAR emulation: - Respect the MEMEN and PORTEN bits in the command register - Allow the guest to reprogram the address decoded by the BAR
Submitted by: Gopakumar T Obtained from: NetApp
|
249175 |
05-Apr-2013 |
grehan |
Remove dangling ISA uart stubs.
Obtained from: NetApp
|
249173 |
05-Apr-2013 |
grehan |
config checksum is over the entire fixed portion, not just the config header. FreeBSD doesn't check this but other o/s's do.
Obtained from: NetApp
|
248477 |
18-Mar-2013 |
neel |
Simplify the assignment of memory to virtual machines by requiring a single command line option "-m <memsize in MB>" to specify the memory size.
Prior to this change the user needed to explicitly specify the amount of memory allocated below 4G (-m <lowmem>) and the amount above 4G (-M <highmem>).
The "-M" option is no longer supported by 'bhyveload' and 'bhyve'.
The start of the PCI hole is fixed at 3GB and cannot be directly changed using command line options. However it is still possible to change this in special circumstances via the 'vm_set_lowmem_limit()' API provided by libvmmapi.
Submitted by: Dinakar Medavaram (initial version) Reviewed by: grehan Obtained from: NetApp
|
248368 |
16-Mar-2013 |
neel |
Change the type of 'ndesc' from 'int' to 'uint16_t' so that descriptor index wraparound is handled correctly.
The gory details are available here: http://lists.freebsd.org/pipermail/freebsd-virtualization/2013-March/001119.html
This fixes a regression introduced in r247871.
Pointed out by: Bruce Evans, Chris Torek
|
248171 |
11-Mar-2013 |
neel |
Convert the offset into the bar that contains the MSI-X table to an offset into the MSI-X table before using it to calculate the table index.
In the common case where the MSI-X table is located at the begining of the BAR these two offsets are identical and thus the code was working by accident.
This change will fix the case where the MSI-X table is located in the middle or at the end of the BAR that contains it.
Obtained from: NetApp
|
247871 |
06-Mar-2013 |
grehan |
Simplify virtio ring num-available calculation.
Submitted by: Chris Torek, torek at torek dot net
|
247865 |
06-Mar-2013 |
grehan |
Reorder code to avoid the stat buffer being used uninitialized.
Obtained from: NetApp
|
247523 |
01-Mar-2013 |
neel |
Specify the length of the mapping requested from 'paddr_guest2host()'.
This seems prudent to do in its own right but it also opens up the possibility of not having to mmap the entire guest address space in the 'bhyve' process context.
Discussed with: grehan Obtained from: NetApp
|
247342 |
26-Feb-2013 |
neel |
Ignore the BARRIER flag in the virtio block header.
This capability is not advertised by the host so ignore it even if the guest insists on setting the flag.
Reviewed by: grehan Obtained from: NetApp
|
247282 |
25-Feb-2013 |
neel |
Get rid of unused struct member.
Pointed out by: Gopakumar T Obtained from: NetApp
|
247144 |
22-Feb-2013 |
grehan |
Add the ability to have a 'fallback' search for memory ranges. These set of ranges will be looked at if a standard memory range isn't found, and won't be installed in the cache. Use this to implement the memory behaviour of the PCI hole on x86 systems, where writes are ignored and reads always return -1. This allows breakpoints to be set when issuing a 'boot -d', which has the side effect of accessing the PCI hole when changing the PTE protection on kernel code, since the pmap layer hasn't been initialized (a bug, but present in existing FreeBSD releases so has to be handled).
Reviewed by: neel Obtained from: NetApp
|
246846 |
15-Feb-2013 |
neel |
Advertise PCI-E capability in the hostbridge device presented to the guest.
FreeBSD wants to see this capability in at least one device in the PCI hierarchy before it allows use of MSI or MSI-X.
Obtained from: NetApp
|
246686 |
11-Feb-2013 |
neel |
Implement guest vcpu pinning using 'pthread_setaffinity_np(3)'.
Prior to this change pinning was implemented via an ioctl (VM_SET_PINNING) that called 'sched_bind()' on behalf of the user thread.
The ULE implementation of 'sched_bind()' bumps up 'td_pinned' which in turn runs afoul of the assertion '(td_pinned == 0)' in userret().
Using the cpuset affinity to implement pinning of the vcpu threads works with both 4BSD and ULE schedulers and has the happy side-effect of getting rid of a bunch of code in vmm.ko.
Discussed with: grehan
|
246367 |
05-Feb-2013 |
jhb |
Install <dev/agp/agpreg.h> and <dev/pci/pcireg.h> as userland headers in /usr/include.
MFC after: 2 weeks
|
246214 |
01-Feb-2013 |
neel |
Add support for MSI-X interrupts in the virtio block device and make that the default.
The current behavior of advertising a single MSI vector can be requested by setting the environment variable "BHYVE_USE_MSI" to "yes". The use of MSI is not compliant with the virtio specification and will be eventually phased out.
Submitted by: Gopakumar T Obtained from: NetApp
|
246191 |
01-Feb-2013 |
neel |
Fix a broken assumption in the passthru implementation that the MSI-X table can only be located at the beginning or the end of the BAR.
If the MSI-table is located in the middle of a BAR then we will split the BAR into two and create two mappings - one before the table and one after the table - leaving a hole in place of the table so accesses to it can be trapped and emulated.
Obtained from: NetApp
|
246190 |
01-Feb-2013 |
neel |
Fix a bug in the passthru implementation where it would assume that all devices are MSI-X capable. This in turn would lead it to treat bar 0 as the MSI-X table bar even if the underlying device did not support MSI-X.
Fix this by providing an API to query the MSI-X table index of the emulated device. If the underlying device does not support MSI-X then this API will return -1.
Obtained from: NetApp
|
246109 |
30-Jan-2013 |
neel |
Add support for MSI-X interrupts in the virtio network device and make that the default.
The current behavior of advertising a single MSI vector can be requested by setting the environment variable "BHYVE_USE_MSI" to "true". The use of MSI is not compliant with the virtio specification and will be eventually phased out.
Submitted by: Gopakumar T Obtained from: NetApp
|
245920 |
25-Jan-2013 |
grehan |
Improve correctness of rtc register implementation.
Submitted by: tycho nightingale at pluribusnetworks com
|
245899 |
25-Jan-2013 |
neel |
Use the correct type (uint64_t) to retrieve sysctl machdep.tsc_freq.
Simplify the function a bit by falling through after initialization and return via the normal code path.
Reviewed by: grehan Obtained from: NetApp
|
245749 |
21-Jan-2013 |
neel |
Allocate the memory for the MSI-X table dynamically instead of allocating 32KB statically. In most cases the number of table entries will be far less than the maximum of 2048 allowed by the PCI specification.
Reuse macros from pcireg.h to interpret the MSI-X capability instead of rolling our own.
Obtained from: NetApp
|
245740 |
21-Jan-2013 |
neel |
Get rid of redundant 'table_size' field in struct pi_msix. If needed it can always be calculated from the number of entries in the MSI-X table.
Obtained from: NetApp
|
245679 |
20-Jan-2013 |
neel |
Use <vmname> in a consistent manner in usage messages output by 'bhyve', 'bhyveload' and 'bhyvectl'.
Pointed out by: joel@
|
245678 |
20-Jan-2013 |
neel |
Add svn properties to the recently merged bhyve source files.
The pre-commit hook will not allow any commits without the svn:keywords property in head.
|
245652 |
19-Jan-2013 |
neel |
Merge projects/bhyve to head.
'bhyve' was developed by grehan@ and myself at NetApp (thanks!).
Special thanks to Peter Snyder, Joe Caradonna and Michael Dexter for their support and encouragement.
Obtained from: NetApp
|
245127 |
07-Jan-2013 |
grehan |
Don't completely drain the read file descriptor. Instead, only fill up to the uart's rx fifo size, and leave any remaining input for when the rx fifo is read. This allows cut'n'paste of long lines to be done into the bhyve console without truncation.
Also, introduce a mutex since the file input will run in the mevent thread context and may corrupt state accessed by a vCPU thread.
Reviewed by: neel Approved by: NetApp
|
245123 |
07-Jan-2013 |
grehan |
Use 64-bit arithmetic throughout, and lock accesses to globals. With this change, dbench with >= 4 processes runs without getting weird jumps forward in time when the APCI pmtimer is the default timecounter.
Obtained from: NetApp
|
245020 |
04-Jan-2013 |
neel |
The "unrestricted guest" capability is a feature of Intel VT-x that allows the guest to execute real or unpaged protected mode code - bhyve relies on this feature to execute the AP bootstrap code.
Get rid of the hack that allowed bhyve to support SMP guests on processors that do not have the "unrestricted guest" capability. This hack was entirely FreeBSD-specific and would not work with any other guest OS.
Instead, limit the number of vcpus to 1 when executing on processors without "unrestricted guest" capability.
Suggested by: grehan Obtained from: NetApp
|
244520 |
20-Dec-2012 |
grehan |
Change thread name for the main kqueue event loop to "<vmname> mevent" so it can be easily distinguished from other non-vCPU threads in forthcoming changes.
Obtained from: NetApp
|
244167 |
13-Dec-2012 |
grehan |
Rename fbsdrun.* -> bhyverun.*
bhyve is intended to be a generic hypervisor, and not FreeBSD-specific.
(renaming internal routines will come later)
Reviewed by: neel Obtained from: NetApp
|
244160 |
12-Dec-2012 |
grehan |
Properly reset the tx/rx rings when a guest requests a device reset.
Obtained from: NetApp
|
244159 |
12-Dec-2012 |
grehan |
Create unique MAC addresses for virtio devices that are created with non-zero PCI function numbers.
Remove obsolete reference to CFE.
Obtained from: NetApp
|
244013 |
08-Dec-2012 |
grehan |
Determine the correct length and sector size for raw devices.
Obtained from: NetApp Tested by: Michael Dexter with iscsi LUNs
|
243704 |
30-Nov-2012 |
grehan |
- Add in an XSDT to stop acpidump from exiting with a 'XSDT corrupted' error - Fix up OEMID/OEM Table ID string padding in the DSDT.
Output on a verbose boot now looks like
... ACPI: RSDP 0xf0400 00024 (v02 BHYVE ) ACPI: XSDT 0xf0480 00034 (v01 BHYVE BVXSDT 00000001 INTL 20120320) ACPI: APIC 0xf0500 0004A (v01 BHYVE BVMADT 00000001 INTL 20120320) ACPI: FACP 0xf0600 0010C (v05 BHYVE BVFACP 00000001 INTL 20120320) ACPI: DSDT 0xf0800 000F2 (v02 BHYVE BVDSDT 00000001 INTL 20120320) ACPI: FACS 0xf0780 00040 ...
Obtained from: NetApp
|
243651 |
28-Nov-2012 |
neel |
Cleanup the user-space paging exit handler now that the unified instruction emulation is in place.
Obtained from: NetApp
|
243640 |
28-Nov-2012 |
neel |
Revamp the x86 instruction emulation in bhyve.
On a nested page table fault the hypervisor will: - fetch the instruction using the guest %rip and %cr3 - decode the instruction in 'struct vie' - emulate the instruction in host kernel context for local apic accesses - any other type of mmio access is punted up to user-space (e.g. ioapic)
The decoded instruction is passed as collateral to the user-space process that is handling the PAGING exit.
The emulation code is fleshed out to include more addressing modes (e.g. SIB) and more types of operands (e.g. imm8). The source code is unified into a single file (vmm_instruction_emul.c) that is compiled into vmm.ko as well as /usr/sbin/bhyve.
Reviewed by: grehan Obtained from: NetApp
|
243391 |
22-Nov-2012 |
neel |
MSI-X does not need to be enabled in the message control register for the guest to access the MSI-x tables.
Obtained from: NetApp
|
243349 |
21-Nov-2012 |
neel |
Mask the %eax register properly based on whether the "out" instruction is operating on 1, 2 or 4 bytes.
There could be garbage in the unused bytes so zero them off.
Obtained from: NetApp
|
243327 |
20-Nov-2012 |
grehan |
ACPI support for bhyve.
The -A option will create the minimal set of required ACPI tables in guest memory. Since ACPI mandates an IOAPIC, the -I option must also be used.
Template ASL files are created, and then passed to the iasl compiler to generate AML files. These are then loaded into guest physical mem.
In support of this, the ACPI PM timer is implemented, in 32-bit mode.
Tested on 7.4/8.*/9.*/10-CURRENT.
Reviewed by: neel Obtained from: NetApp Discussed with: jhb (a long while back)
|
242882 |
11-Nov-2012 |
neel |
IFC @ r242684
|
242404 |
31-Oct-2012 |
grehan |
Change the thread name of the vCPU threads to contain the name of the VM and the vCPU number. This helps hugely when using top -H to identify what a VM is doing.
Reviewed by: neel Obtained from: NetApp
|
242385 |
31-Oct-2012 |
grehan |
Exit if the requested num vCPUs exceeds the maximum rather than waiting until AP bringup detects an out-of-range vCPU.
While here, fix all error output to use fprintf(stderr, ...
Reviewed by: neel Reported by: @allanjude
|
242195 |
27-Oct-2012 |
neel |
Present the bvm dbgport to the guest only when explicitly requested via the "-g" command line option.
Suggested by: grehan Obtained from: NetApp
|
242192 |
27-Oct-2012 |
neel |
Present the bvm console device to the guest only when explicitly requested via the "-b" command line option.
Reviewed by: grehan Obtained from: NetApp
|
242170 |
27-Oct-2012 |
neel |
Ignore PCI configuration accesses to all bus numbers other than PCI bus 0.
Obtained from: NetApp
|
242131 |
26-Oct-2012 |
grehan |
Remove mptable generation code from libvmmapi and move it to bhyve. Firmware tables require too much knowledge of system configuration, and it's difficult to pass that information in general terms to a library. The upcoming ACPI work exposed this - it will also livein bhyve.
Also, remove code specific to NetApp from the mptable name, and remove the -n option from bhyve.
Reviewed by: neel Obtained from: NetApp
|
241744 |
19-Oct-2012 |
grehan |
Rework how guest MMIO regions are dealt with.
- New memory region interface. An RB tree holds the regions, with a last-found per-vCPU cache to deal with the common case of repeated guest accesses to MMIO registers in the same page.
- Support memory-mapped BARs in PCI emulation.
mem.c/h - memory region interface
instruction_emul.c/h - remove old region interface. Use gpa from EPT exit to avoid a tablewalk to determine operand address. Determine operand size and use when calling through to region handler.
fbsdrun.c - call into region interface on paging exit. Distinguish between instruction emul error and region not found
pci_emul.c/h - implement new BAR callback api. Split BAR alloc routine into routines that require/don't require the BAR phys address.
ioapic.c pci_passthru.c pci_virtio_block.c pci_virtio_net.c pci_uart.c - update to new BAR callback i/f
Reviewed by: neel Obtained from: NetApp
|
241490 |
12-Oct-2012 |
neel |
Deal with transient EBUSY error return from vm_run() by retrying the operation.
|
240943 |
26-Sep-2012 |
neel |
Add an option "-a" to present the local apic in the XAPIC mode instead of the default X2APIC mode to the guest.
|
240912 |
25-Sep-2012 |
neel |
Add an explicit exit code 'SPINUP_AP' to tell the controlling process that an AP needs to be activated by spinning up an execution context for it.
The local apic emulation is now completely done in the hypervisor and it will detect writes to the ICR_LO register that try to bring up the AP. In response to such writes it will return to userspace with an exit code of SPINUP_AP.
Reviewed by: grehan
|
239086 |
06-Aug-2012 |
neel |
Fix a bug in how a 64-bit bar in a pci passthru device would be presented to the guest. Prior to the fix it was possible for such a bar to appear as a 32-bit bar as long as it was allocated from the region below 4GB.
This had the potential to confuse some drivers that were particular about the size of the bars.
Obtained from: NetApp
|
239085 |
06-Aug-2012 |
neel |
Add support for emulating PCI multi-function devices.
These function number is specified by an optional [:<func>] after the slot number: -s 1:0,virtio-net,tap0
Ditto for the mptable naming: -n 1:0,e0a
Obtained from: NetApp
|
239045 |
05-Aug-2012 |
neel |
Device model for ioapic emulation.
With this change the uart emulation is entirely interrupt driven.
Obtained from: NetApp
|
239044 |
04-Aug-2012 |
neel |
The displacement field in the decoded instruction should be treated as a 8-bit or 32-bit signed integer.
Simplify the handling of indirect addressing with displacement by unconditionally adding the 'instruction->disp' to the target address. This is alright since 'instruction->disp' is non-zero only for the addressing modes that specify a displacement.
Obtained from: NetApp
|
239043 |
04-Aug-2012 |
neel |
Add the "-I" option to control whether or not an ioapic is visible to the guest.
Obtained from: NetApp
|
239029 |
04-Aug-2012 |
neel |
Use the correct variable to index into the 'lirq[]' array to check the legacy IRQ ownership.
|
239028 |
04-Aug-2012 |
neel |
Check that 'opts' is actually not NULL before dereferencing it. It is expected that 'opts' will be NULL for the second serial port (-S <slot>,uart)
|
234938 |
03-May-2012 |
grehan |
Add 16550 uart emulation as a PCI device. This allows it to be activated as part of the slot config options. The syntax is:
-s <slotnum>,uart[,stdio]
The stdio parameter instructs the code to perform i/o using stdin/stdout. It can only be used for one instance. To allow legacy i/o ports/irqs to be used, a new variant of the slot command, -S, is introduced. When used to specify a slot, the device will use legacy resources if it supports them; otherwise it will be treated the same as the '-s' option. Specifying the -S option with the uart will first use the 0x3f8/irq 4 config, and the second -S will use 0x2F8/irq 3.
Interrupt delivery is awaiting the arrival of the i/o apic code, but this works fine in uart(4)'s polled mode.
This code was written by Cynthia Lu @ MIT while an intern at NetApp, with further work from neel@ and grehan@.
Obtained from: NetApp
|
234761 |
28-Apr-2012 |
grehan |
MSI-x interrupt support for PCI pass-thru devices.
Includes instruction emulation for memory r/w access. This opens the door for io-apic, local apic, hpet timer, and legacy device emulation.
Submitted by: ryan dot berryhill at sandvine dot com Reviewed by: grehan Obtained from: Sandvine
|
226521 |
18-Oct-2011 |
grehan |
Ignore legacy INIT de-asserts in x2apic mode before verifying the contents of the IPI. Uncovered by jhb's x2apic patch.
Obtained from: NetApp
|
222830 |
07-Jun-2011 |
grehan |
Allow access to the device's config area with any size i/o access at any offset. This is now spec-compliant.
|
222238 |
24-May-2011 |
grehan |
Catch up with CURRENTs different timer usage compared to 8.1. A counter value of 0 in rategen mode is equivalent to a max initial value. The TSC is now correctly calibrated on a 9.0 guest.
Obtained from: NetApp
|
222105 |
19-May-2011 |
grehan |
Changes to allow the GENERIC+bhye kernel built from this branch to run as a 1/2 CPU guest on an 8.1 bhyve host.
bhyve/inout.c inout.h fbsdrun.c - Rather than exiting on accesses to unhandled i/o ports, emulate hardware by returning -1 on reads and ignoring writes to unhandled ports. Support the previous mode by allowing a 'strict' parameter to be set from the command line. The 8.1 guest kernel was vastly cut down from GENERIC and had no ISA devices. Booting GENERIC exposes a massive amount of random touching of i/o ports (hello syscons/vga/atkbdc).
bhyve/consport.c dev/bvm/bvm_console.c - implement a simplistic signature for the bvm console by returning 'bv' for an inw on the port. Also, set the priority of the console to CN_REMOTE if the signature was returned. This works better in an environment where multiple consoles are in the kernel (hello syscons)
bhyve/rtc.c - return 0 for the access to RTC_EQUIPMENT (yes, you syscons)
amd64/vmm/x86.c x86.h - hide a bunch more CPUID leaf 1 bits from the guest to prevent cpufreq drivers from probing. The next step will be to move CPUID handling completely into user-space. This will allow the full spectrum of changes from presenting a lowest-common-denominator CPU type/feature set, to exposing (almost) everything that the host can support.
Reviewed by: neel Obtained from: NetApp
|
221942 |
15-May-2011 |
jhb |
First cut to port bhyve, vmmctl, and libvmmapi to HEAD.
|
221828 |
13-May-2011 |
grehan |
Import of bhyve hypervisor and utilities, part 1. vmm.ko - kernel module for VT-x, VT-d and hypervisor control bhyve - user-space sequencer and i/o emulation vmmctl - dump of hypervisor register state libvmm - front-end to vmm.ko chardev interface
bhyve was designed and implemented by Neel Natu.
Thanks to the following folk from NetApp who helped to make this available: Joe CaraDonna Peter Snyder Jeff Heller Sandeep Mann Steve Miller Brian Pawlowski
|