summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | - Add in an XSDT to stop acpidump from exiting with agrehan2012-11-301-8/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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
| * | | | | | Properly screen for the AND 0x81 instruction from the setgrehan2012-11-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of group1 0x81 instructions that use the reg bits as an extended opcode. Still todo: properly update rflags. Pointed out by: jilles@
| * | | | | | Remove debug printf.grehan2012-11-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Pointed out by: emaste
| * | | | | | Add support for the 0x81 AND instruction, now generatedgrehan2012-11-292-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by clang in the local APIC code. 0x81 is a read-modify-write instruction - the EPT check that only allowed read or write and not both has been relaxed to allow read and write. Reviewed by: neel Obtained from: NetApp
| * | | | | | Cleanup the user-space paging exit handler now that the unified instructionneel2012-11-285-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | emulation is in place. Obtained from: NetApp
| * | | | | | Change emulate_rdmsr() and emulate_wrmsr() to return 0 on sucess and errno onneel2012-11-283-65/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | failure. The conversion from the return value to HANDLED or UNHANDLED can be done locally in vmx_exit_process(). Obtained from: NetApp
| * | | | | | Revamp the x86 instruction emulation in bhyve.neel2012-11-2816-915/+649
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | | MSI-X does not need to be enabled in the message control register for theneel2012-11-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | guest to access the MSI-x tables. Obtained from: NetApp
| * | | | | | Fix a bug in the MSI-X resource allocation for PCI passthrough devices.neel2012-11-221-37/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case where the underlying host had disabled MSI-X via the "hw.pci.enable_msix" tunable, the ppt_setup_msix() function would fail and return an error without properly cleaning up. This in turn would cause a page fault on the next boot of the guest. Fix this by calling ppt_teardown_msix() in all the error return paths. Obtained from: NetApp
| * | | | | | Get rid of redundant comparision which is guaranteed to be "true" for unsignedneel2012-11-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | integers. Obtained from: NetApp
| * | | | | | Mask the %eax register properly based on whether the "out" instruction isneel2012-11-211-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | operating on 1, 2 or 4 bytes. There could be garbage in the unused bytes so zero them off. Obtained from: NetApp
| * | | | | | ACPI support for bhyve.grehan2012-11-205-5/+958
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
| * | | | | | Handle CPUID leaf 0x7 now that FreeBSD is using it.grehan2012-11-202-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return 0's for now. Reviewed by: neel Obtained from: NetApp
| * | | | | | disk_open() is smart enough to detect MBR and GPT partitions. If it is neitherneel2012-11-201-29/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | then fall back to accessing the disk as a raw device. As an example this is useful when booting the guest from an ISO image file. Discussed with: grehan Obtained from: NetApp
| * | | | | | IFC @ r243164neel2012-11-17324-2467/+3876
| |\ \ \ \ \ \
| * \ \ \ \ \ \ IFC @ r242940neel2012-11-13251-2349/+5617
| |\ \ \ \ \ \ \
| * | | | | | | | Revert r229954 which in turn had reverted r228556 in projects/bhyve.neel2012-11-132-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was done to work around build issues when building projects/bhyve on an 8.x system at the time. The workaround is no longer needed so re-instantiate r228556 in projects/bhyve. Discussed with: grehan@ Obtained from: NetApp
| * | | | | | | | IFC @ r242684neel2012-11-118512-387891/+906061
| |\ \ \ \ \ \ \ \
| * | | | | | | | | Use the new userboot 'getenv' callback to set a couple of environment variablesneel2012-11-061-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in the guest. The variables are: smbios.bios.vendor=BHYVE and boot_serial=1 The FreeBSD guest uses the "smbios.bios.vendor" environment variable to detect whether or not it is running as a guest inside a hypervisor. The "boot_serial=1" is temporary and will be dropped when bhyve can do VGA emulation. Obtained from: NetApp
| * | | | | | | | | Add a callback function to userboot.so to fetch a list of environmentneel2012-11-063-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | variables and pass them to the kernel. Bump up the userboot version to USERBOOT_VERSION_3. This takes into account the bump to USERBOOT_VERSION_2 that has already happened in head (but not propagated to this branch yet). Reviewed by: dfr@ Obtained from: NetApp
| * | | | | | | | | Fix issue found with clang build. Avoid code insertion by the compilergrehan2012-11-061-29/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | between inline asm statements that would in turn modify the flags value set by the first asm, and used by the second. Solve by making the common error block a string that can be pulled into the first inline asm, and using symbolic labels for asm variables. bhyve can now build/run fine when compiled with clang. Reviewed by: neel Obtained from: NetApp
| * | | | | | | | | Change the thread name of the vCPU threads to contain thegrehan2012-10-311-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | | | | | Exit if the requested num vCPUs exceeds the maximum rathergrehan2012-10-311-16/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | | | | | Teach FreeBSD to detect that it is a guest running inside BHyVe.neel2012-10-302-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed by: grehan Obtained from: NetApp
| * | | | | | | | | Convert VMCS_ENTRY_INTR_INFO field into a vmcs identifier before passing itneel2012-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to vmcs_getreg(). Without this conversion vmcs_getreg() will return EINVAL. In particular this prevented injection of the breakpoint exception into the guest via the "-B" option to /usr/sbin/bhyve which is hugely useful when debugging guest hangs. This was broken in r241921. Pointy hat: me Obtained from: NetApp
| * | | | | | | | | Corral all the host state associated with the virtual machine into its own file.neel2012-10-297-24/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This state is independent of the type of hardware assist used so there is really no need for it to be in Intel-specific code. Obtained from: NetApp
| * | | | | | | | | Present the bvm dbgport to the guest only when explicitly requested vianeel2012-10-271-27/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the "-g" command line option. Suggested by: grehan Obtained from: NetApp
| * | | | | | | | | Probe for existence of the bvm debug port instead of just assuming that it isneel2012-10-271-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | always present. Suggested by: grehan Obtained from: NetApp
| * | | | | | | | | Present the bvm console device to the guest only when explicitly requested vianeel2012-10-273-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the "-b" command line option. Reviewed by: grehan Obtained from: NetApp
| * | | | | | | | | Ignore PCI configuration accesses to all bus numbers other than PCI bus 0.neel2012-10-271-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Obtained from: NetApp
| * | | | | | | | | Rename vmmctl to bhyvectl. 'vmmctl' came from a pre-bhyvegrehan2012-10-275-78/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | internal codebase at NetApp. No need for it to have an unrelated name to the other userspace utils. Reviewed by: neel Obtained from: NetApp
| * | | | | | | | | Set the valid field of the newly allocated field as all othergrehan2012-10-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vm page allocators do. This fixes a panic when a virtio block device is mounted as root, with the host system dying in vm_page_dirty with invalid bits. Reviewed by: neel Obtained from: NetApp
| * | | | | | | | | Remove mptable generation code from libvmmapi and move it to bhyve.grehan2012-10-2611-511/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | | | | | Unconditionally enable fpu emulation by setting CR0.TS in the host after theneel2012-10-262-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | guest does a vm exit. This allows us to trap any fpu access in the host context while the fpu still has "dirty" state belonging to the guest. Reported by: "s vas" on freebsd-virtualization@ Obtained from: NetApp
| * | | | | | | | | If the guest vcpu wants to idle then use that opportunity to relinquish theneel2012-10-252-23/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | host cpu to the scheduler until the guest is ready to run again. This implies that the host cpu utilization will now closely mirror the actual load imposed by the guest vcpu. Also, the vcpu mutex now needs to be of type MTX_SPIN since we need to acquire it inside a critical section. Obtained from: NetApp
| * | | | | | | | | Hide the monitor/mwait instruction capability from the guest until we know howneel2012-10-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to properly intercept it. Obtained from: NetApp
| * | | | | | | | | Fix typo: host_rip -> host_rspneel2012-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Obtained from: NetApp
| * | | | | | | | | Maintain state regarding NMI delivery to guest vcpu in VT-x independent manner.neel2012-10-245-34/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also add a stats counter to count the number of NMIs delivered per vcpu. Obtained from: NetApp
| * | | | | | | | | Test for AST pending with interrupts disabled right before entering the guest.neel2012-10-234-28/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an IPI was delivered to this cpu before interrupts were disabled then return right away via vmx_setjmp() with a return value of VMX_RETURN_AST. Obtained from: NetApp
| * | | | | | | | | Calculate the number of host ticks until the next guest timer interrupt.neel2012-10-204-56/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This information will be used in conjunction with guest "HLT exiting" to yield the thread hosting the virtual cpu. Obtained from: NetApp
| * | | | | | | | | Rework how guest MMIO regions are dealt with.grehan2012-10-1913-374/+850
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
| * | | | | | | | | Add the guest physical address and r/w/x bits togrehan2012-10-122-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the paging exit in preparation for a rework of bhyve MMIO handling. Reviewed by: neel Obtained from: NetApp
| * | | | | | | | | Deal with transient EBUSY error return from vm_run() by retrying the operation.neel2012-10-121-2/+13
| | | | | | | | | |
| * | | | | | | | | Provide per-vcpu locks instead of relying on a single big lock.neel2012-10-127-76/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also gets rid of all the witness.watch warnings related to calling malloc(M_WAITOK) while holding a mutex. Reviewed by: grehan
| * | | | | | | | | Output the value of all capabilities when the "--getcap" option is used withoutneel2012-10-121-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a "--capname=<capname>". Do the same for the "--get-all" option.
| * | | | | | | | | Add an api to map a vm capability type into a string to be used for displayneel2012-10-122-11/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | purposes.
| * | | | | | | | | Fix warnings generated by 'debug.witness.watch' during VM creation andneel2012-10-113-39/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | destruction for calling malloc() with M_WAITOK while holding a mutex. Do not allow vmm.ko to be unloaded until all virtual machines are destroyed.
| * | | | | | | | | Deliver the MSI to the correct guest virtual cpu.neel2012-10-111-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this change the MSI was being delivered unconditionally to vcpu 0 regardless of how the guest programmed the MSI delivery.
| * | | | | | | | | Grab the softc from the ACPI host-pci bridge device instead of from the pcineel2012-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | endpoint device. Reviewed by: jhb
| * | | | | | | | | Allocate memory pages for the guest from the host's free page queue.neel2012-10-088-374/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is no longer necessary to hard-partition the memory between the host and guests at boot time.
OpenPOWER on IntegriCloud