| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
virtio-block does not exist, the correct name is virtio-blk.
PR: 185573
Submitted by: Allan Jude
Facilitated by: Snow B.V.
|
|
|
|
|
|
| |
Fix the processor table entry structure to use a fixed-width type for
32-bit fields so it is the correct size on amd64. Remove a workaround
for the broken structure from bhyve(8).
|
|
|
|
|
|
|
|
| |
r259302
bhyve(8) man page
r259413
mdoc: sort SEE ALSO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Discussed with: neel
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
| |
the memory size more intuitively (e.g. 512M, 4G etc).
Submitted by: rodrigc
Reviewed by: grehan
Approved by: re (blanket)
|
|
|
|
|
|
|
|
|
|
|
| |
"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
|
|
|
|
|
|
|
| |
usr.sbin/bhyve/bhyverun.c is no longer used, so remove it to silence a
gcc warning.
Approved by: re (glebius)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
| |
Approved by: re@ (blanket)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Approved by: re@ (blanket)
|
|
|
|
|
|
|
| |
trigger this.
Reported by: Chris Torek, Allan Jude
Approved by: re@ (blanket)
|
|
|
|
|
|
|
| |
s/w-strobe timer modes. These are commonly used by non-FreeBSD
o/s's.
Approved by: re@ (blanket)
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
| |
though without any action. This avoids a hypervisor exit when
o/s's access these regs (Linux).
Reviewed by: neel
Approved by: re@ (blanket)
|
|
|
|
|
|
|
| |
RTC NVRAM.
Submitted by: Bela Lubkin bela dot lubkin at tidalscale dot com
Approved by: re@ (blanket)
|
|
|
|
|
|
|
| |
not the actual PCI BAR number.
Reviewed by: neel
Approved by: re@ (blanket)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
| |
|
|
|
|
|
| |
precisely emulated, it is good enough for the single consumer
i.e. irq4, the serial port on Linux.
|
|
|
|
|
| |
by the PCI specification but needed to dump MMIO space from "ddb" in the
guest.
|
|
|
|
| |
Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
|
|
|
|
| |
Submitted by: Jeremiah Lott jlott at averesystems dot com
|
|
|
|
|
|
| |
or there is no registered handler.
Submitted by: Bela Lubkin bela dot lubkin at tidalscale dot com
|
|
|
|
|
|
|
| |
the net/block devices accordingly.
Submitted by: Chris Torek torek at torek dot net
Reviewed by: grehan
|
|
|
|
|
|
|
| |
by FreeBSD and UEFI.
Tested with nvram(4).
Reviewed by: neel
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
| |
Clean up some other unnecessary code.
Submitted by: Dinakar Medavaram dinnu sun at gmail
Reviewed by: neel
|
|
|
|
|
|
|
| |
during Linux boot.
Submitted by: tycho nightingale at pluribusnetworks com
Reviewed by: neel
|
|
|
|
|
|
|
| |
kernel does this. Also remove an unused header file.
Submitted by: tycho nightingale at pluribusnetworks com
Reviewed by: neel
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Obtained from: NetApp
|
|
|
|
|
|
| |
mutex for this purpose.
Reviewed by: grehan
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
| |
consume all writes without any side effects.
Obtained from: NetApp
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Pointed out by: Tycho Nightingale (tycho.nightingale@plurisbusnetworks.com)
|