summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include/vmmvar.h
AgeCommit message (Collapse)Author
2018-09-20vmm(4): Clear the guest MWAITX/MONITORX extended CPUID feature bit,Bryan Steele
like we already do for MWAIT/MONITOR. Also match Intel here by not exposing the SVM capability to AMD guests. Allows Linux guests to boot in vmd(8) on Ryzen CPUs. ok mlarkin@
2018-08-21Perform mitigations for Intel L1TF screwup. There are three options:Theo de Raadt
(1) Future cpus which don't have the bug, (2) cpu's with microcode containing a L1D flush operation, (3) stuffing the L1D cache with fresh data and expiring old content. This stuffing loop is complicated and interesting, no details on the mitigation have been released by Intel so Mike and I studied other systems for inspiration. Replacement algorithm for the L1D is described in the tlbleed paper. We use a 64K PA-linear region filled with trapsleds (in case there is L1D->L1I data movement). The TLBs covering the region are loaded first, because TLB loading apparently flows through the D cache. Before performing vmlaunch or vmresume, the cachelines covering the guest registers are also flushed. with mlarkin, additional testing by pd, handy comments from the kettenis and guenther peanuts
2018-07-12zap an extra newlineMike Larkin
2018-07-12vmm(8)/vmm(4): send a copy of the guest register state to vmd on exit,Mike Larkin
avoiding multiple readregs ioctls back to vmm in case register content is needed subsequently. ok phessler
2018-07-11vmm(4): return proper cache topology for cpuid(0x4)Mike Larkin
Make the cache neighbor fields match the number of VCPUs present (currently 1) ok reyk
2018-07-05forgot to commit vmmvar.h needed by previous two commits, thanks ccardenasMike Larkin
for noticing.
2018-04-27vmm(4): pass through ELCRx ports to vmd(8)Mike Larkin
These ports are used for Edge/Level control on the legacy PIC and will be needed for a subsequent commit.
2018-04-26vmm(4): passthrough port 0x61 to vmd(8)Mike Larkin
ok guenther
2018-03-29Remove RDTSCP from the CPUID flags reported to the guest VM. The instructionMike Larkin
was already disabled, but reporting it as available and then failing it caused SmartOS to crash during boot. ok pd@
2017-11-29make vmm(4) less responsible for initial register state, preferring to letMike Larkin
usermode daemons handle that. ok pd@
2017-11-29add some comments. no functional changeMike Larkin
2017-11-17vmmvar.h changes for upcoming cdrom support in vmd(8).Mike Larkin
Diff from carlos cardenas, thanks
2017-08-20vmd: Allow only upward migrationpd
This restricts receiving vms from hosts with more cpu features. Tested on broadwell -> skylake (works) skylake -> broadwell (don't work) ok mlarkin@
2017-08-14vmm: add #defines for exception vectors that can be used to injectMike Larkin
various events into the guest
2017-08-12vmm: handle IA32_MISC_ENABLE MSR. Bits set in this MSR can result inMike Larkin
some feature flags in CPUID being set or cleared. ok pd
2017-08-05vmm: support more than 3855MB guest memoryMike Larkin
guest VMs can now use MAXDSIZ ram. ok deraadt@, stefan@, pd@
2017-07-12Make max memory for VMs equal to MAXDSIZ to avoid failing later duringMike Larkin
VM setup. ok pd
2017-07-06vmd: increase the max number of disks from 2 to 4. Requires kernel rebuildMike Larkin
as a struct passed to vmm has changed size. ok deraadt, pd
2017-05-30event injection framework, will be used for other features coming shortlyMike Larkin
ok deraadt
2017-05-30FPU context save/restore for SVM in vmm(4), matches a previous diffMike Larkin
from a few weeks ago that did the same for Intel/VMX. ok deraadt
2017-05-28rename some fieldsMike Larkin
2017-05-19Respect max VPID/ASID limits. VMX VPIDs are capped at 4095, for now.Mike Larkin
2017-05-05Allow setting guest %xcr0 from vmd(8).Mike Larkin
Tested on linux and amd64 OpenBSD guests. Posted to tech by Pratik Vyas.
2017-05-02Allow setting of guest MSRs from vmd(8). This change is the first part ofMike Larkin
a larger effort to implement vmctl send/vmctl receive (snapshot and VM migration). From Pratik Vyas, Siri Chandana, Harshada Mone and Ashwin Agrawal, a group of students I am supervising. ok kettenis
2017-04-28vmm: don't use invvpid if we didn't detect vpid capability duringMike Larkin
vcpu setup
2017-04-27rename a struct that was denoted as "VMX only" to make it more clearMike Larkin
that it can be used in SVM and VMX. no functional change
2017-04-27vmm(4): proper save/restore of FPU context during entry/exit.Mike Larkin
tested by reyk, dcoppa, and a few others. ok kettenis@ on the fpu bits ok deraadt@ on the vmm bits
2017-03-23Bump the emulated PCI MMIO range end to 0xFFFFFFFF. This slightlyMike Larkin
penalizes i386 guests who previously had memory allocated by vmd after 0xF0FFFFFF (the previous range end) but makes memory range calculation in vmd/mc146818 much much easier. This diff needs to be combined with the previous vmd diffs or you won't be able to create a vm with memory size larger than ~3855MB.
2017-02-20SVM: asm support for SVM/RVIMike Larkin
2017-01-24SVM: misspelled field name in vmcb struct (renamed to match SVM code I'mMike Larkin
merging)
2017-01-19forgot this in previous commit (SVM_MSR* macro definitions)Mike Larkin
2017-01-19rename a couple of macros that are causing me a merge headache with theMike Larkin
next SVM diff
2017-01-19SVM: vcpu_init_svm - allocate memory for control structures (vmcb,Mike Larkin
msr bitmap, ioio bitmap, and host state save area)
2017-01-13Starting to merge my old AMD SVM/RVI tree, piece by piece.Mike Larkin
SVM/RVI: VMCB structure definitions for amd64/i386
2017-01-12Remove vc_hsa_stack_va, it has not been used in a long time and is noMike Larkin
longer needed.
2017-01-11SVM intercept codes (exit reason) definesMike Larkin
2016-10-26Don't use a bitfield in the msr store index structure. This may not end upMike Larkin
initializing the unused bits, leading to VMABORTs during vmentry. Found the hard way on i386 vmm, but the problem could occur on amd64 as well.
2016-10-12Allow 4 vio(4) interfaces in each VM. Also fix a bad interrupt assignment thatMike Larkin
caused IRQ9 to be shared between the second disk device and the vio(4)s, which caused poor network performance. ok reyk, stefan
2016-10-06add a debug function that was useful in finding the previousMike Larkin
broadwell/skylake bug.
2016-10-03disable PAT and MTRR in guest VMsMike Larkin
2016-09-04Restrict MSR access to supported ones, log invalid accesses.Mike Larkin
2016-09-01Make vcpu_reset_regs use new writeregs codeStefan Kempf
Makes reset code a little simpler. ok mlarkin@
2016-09-01Add ioctls to get/set VCPU registersStefan Kempf
ok mlarkin@
2016-09-01Remove the clock hack, and properly handle interrupts generated from vmd(8)'sMike Larkin
forthcoming emulated interrupt controller. ok stefan
2016-06-10Remove readpage and writepage ioctls.Stefan Kempf
They are not needed anymore now that guest memory is allocated by and shared with the host. ok mlarkin@
2016-06-07Allocate RAM for guest VM in vmd(8) and pass it to vmm(4)Stefan Kempf
vmm(4) then maps the pages allocated by the vmd(8) user process into the address space of the guest. This gives vmm(4) and vmd(8) a shared view of the guest RAM. This will allow us to have faster guest<->host data exchange by ordinary memory loads/stores later, as well as remove the vm_readpage and vm_writepage ioctls next. ok mlarkin@
2016-04-25add a few new exit types found in newer cpusMike Larkin
2016-04-06define number of exit/entry save/load MSRs as a #define instead of a magicMike Larkin
number.
2016-03-13Introduce memory ranges to support VMs with >= 4G RAMStefan Kempf
Kernel bits: - When creating a VM, a list of memory ranges has to be specified, similar to the BIOS memory map. This is necessary for VMs with RAM sizes approaching 4G because we'll need PCI MMIO space in the higher parts of the 32 bit address space. vmctl and vmd bits: - Construct appropriate memory ranges to create a VM with a given RAM size - Construct a corresponding BIOS memory map from the memory ranges and update the boot params page accordingly. - Make sure that all variables that represent guest physical addresses match the address width of the target CPU instead of using uint32_t. - Fix some integer promotion glitches that actually restricted VM RAM size to 2G. This changes the VM create ioctl interface, so update your kernel, vmd, and vmctl. ok mlarkin@
2016-03-09Add a comment to the vcpu state enum to remind people there is a matchingMike Larkin
conversion function in vmm.c Increase the size of the pending interrupt field from uint8_t to uint16_t.