summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include
AgeCommit message (Collapse)Author
2016-07-28Store the acpi processor ID/UID in struct cpu_info, and use it to attachMark Kettenis
acpicpu(4) drivers to the right cpu(4). ok mlarkin@, guenther@
2016-07-16Fix an incorrect shift value when calculating the mask for the VMCS MSRMike Larkin
list storage size. Noticed when attempting to get vmm(4) to nest under Hyper-V.
2016-06-29Don't write a 1 to the RIRR bit in the IOAPIC redirection register. This bitMike Larkin
is R/O, and although it should not matter what value is written there, Hyper-V's emulated IOAPIC interprets a write of 1 in some unexpected way and subsequently blocks interrupt delivery. This primarily manifests itself as de(4) timeouts when using Hyper-V VMs with the "Legacy Network Adapter" interface. This diff has been in snaps for almost a month with no reported fallout. Based on an idea originally from mikeb with further input from kettenis and deraadt.
2016-06-22Identify UMIP feature, if available.Mike Larkin
ok millert, kettenis, deraadt
2016-06-22Setup Hyper-V hypercall page and an IDT vector.Mike Belopuhov
ok mlarkin, kettenis, deraadt
2016-06-21add support to efifb for drawing a console on a coreboot framebufferJoshua Stein
if coreboot's memory table is found, it has a framebuffer entry, and there is no previously attached efi, vga, or serial console. useful on chromebooks that have no legacy vga device to get an early console before inteldrm(4) attaches or, for newer chipsets, a full console and X with wsfb(4). ok kettenis
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-05-10SROP mitigation. sendsig() stores a (per-process ^ &sigcontext) cookieTheo de Raadt
inside the sigcontext. sigreturn(2) checks syscall entry was from the exact PC addr in the (per-process ASLR) sigtramp, verifies the cookie, and clears it to prevent sigcontext reuse. not yet tested on landisk, sparc, *88k, socppc. ok kettenis
2016-05-092nd identical definition of PROC_PC macro is not neededTheo de Raadt
from miod
2016-05-04Initial support for MSI-X. Only supported on amd64 for now. I have diffs toMark Kettenis
actually use this in em(4) and xhci(4), but I'm not committing those yet because we almost certainly need to save and restore the MSI-X registers during suspend/resume. However, this allows mpi@ to play with multiple-vector support in networking hardware. Requested by mpi@ ok mlarkin@, mikeb@
2016-04-27G/C DDB_REGS.Martin Pieuchot
2016-04-26Add decode functions for some of the MSRs that are commonly used. OnlyMike Larkin
compiled when VMM_DEBUG is enabled, and only used during VM crash.
2016-04-26Convert some magic numbers into #defines - this is needed for some MTRRMike Larkin
decoding code I'm working on for vmm(4) debugging. No functional change.
2016-04-25cr0, cr3, cr4 diagnostics / debug functions (used when VMs crash)Mike Larkin
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-04-03Move the setting of pcb_fsbase out of reset_segs() into its callersPhilip Guenther
ok mpi@
2016-04-03Remove __lockbarrier() defines, unused since cpu_lock removal a fewJonathan Gray
years ago. ok dlg@
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.
2016-02-27Rename kdb_trap() into db_ktrap().Martin Pieuchot
The goal is to include it in the list of functions that must not be instrumented. All ddb(8) functions should be in this list and have their names start with 'db_'. ok visa@, deraadt@
2016-02-26Rename and move x86 calllframe definitions in <machine/frame.h> to useMartin Pieuchot
it in MI code. ok mlarkin@, visa@
2016-02-20Add "interrupt pending on vcpu" ioctl to vmm. Needed for upcoming interruptMike Larkin
controller work in vmd(8). ok stefan@, mpi@
2016-02-16Allow userland to initialize CR0 when resetting a VCPU instead ofStefan Kempf
hardcoding it. Be careful to obey VMX's must-be-0 and must-be-1 restrictions for CR0. This gives us the opportunity later to start VCPUs in real-mode, etc. (for those CPUs that support unrestricted guest). Be sure to update your vmd(8) also, the ioctl interface has changed. ok mlarkin@, deraadt@
2016-02-08Set EPT bits of guest pages in pmap_enter instead of doing itStefan Kempf
after an uvm_fault: uvm_fault maps in neighboring pages of the faulting page. We want EPT bits set for those as soon as possible as well. This avoids additional EPT violations causing further uvm_faults when the guest accesses the neighboring pages. discussion with and ok mlarkin@
2016-01-10Page fault handling tweaks for vmm:Stefan Kempf
- compute fault reason for uvm_fault() (e.g. page not present, protection violation) instead of passing a protection code - a page does not need to be zero'd after faulting it in. uvm_fault() does that for fresh anon pages already, and we also do not want a page that is swapped back in have its contents wiped. ok mlarkin@
2016-01-08Add "vmm" pledge to allow restricted ioctl access to /dev/vmm.Reyk Floeter
This will allow to pledge vmd(8)'s vmm and vm processes, so that VMs themselves run "sandboxed", including their host-side virtio layer. It will remain disabled for now (in userland) to not get into the way of ongoing development and upcoming changes in vmd and the ioctl interface. OK mlarkin@ deraadt@ "kernel side in, but not the callers in userland"
2016-01-04Do proper termination of VMs by doing proper VCPU run state management.Mike Larkin
This should fix some of the odd termination errors people have been seeing (vmctl status showing running VMs after they have exited/crashed, and invalid instruction panics on vmptrld during certain races) This diff also implements dropping the biglock when running a VCPU, and reacquiring the lock as needed based on the type of exit (normal vs. external interrupt) diff supplied by Stefan Kempf <sn.kempf at t-online.de>, many thanks!
2015-12-17Move vcpu register state init to vmd. Allows vmd bootloader to make theMike Larkin
decision as to how the vcpu should be set up for initial start and reset. Also removes some hardcoded register constants from vmm(4). ok jsing@, mpi@
2015-12-15support reset vcpu by triple fault (kernel part, userland fix will comeMike Larkin
later). discussed with deraadt@ and reyk@ at length.
2015-12-14track used memory in each VM. This is passed back to vmctl status.Mike Larkin
ok reyk@, beck@, mpi@
2015-12-08Set up an IDT vector for Xen callbacksMike Belopuhov
This adds support for delivering the combined Xen interrupt that later fans out into event port specific (device specific) interrupts via an IDT of a guest system. The Xen IDT vector is set to be the first of the IPL_NET group and is implemented the same way LAPIC timer and IPIs are done. The additional machinery is there to be able to mask it via standard mechanisms (e.g. splnet). Discussed with kettenis@, OK mlarkin, reyk
2015-12-07Add cpuid bits documented in the August 2015 revision ofJonathan Gray
"Intel Architecture Instruction Set Extensions Programming Reference"
2015-12-06child_return() is already declared in <sys/proc.h>Philip Guenther
2015-11-26Automatically start vmm(4) when the first VM is created and after theReyk Floeter
last VM is terminated. This allows to remove the explicit "vmm enable" / "vmm disable" (VMM_IOC_START / VMM_IOC_STOP) ioctls. You'll have to update kernel and userland for this change, as the kernel ABI changes. OK mpi@ mlarkin@
2015-11-23No longer need 'option VMM', declaring the vmm0 device is sufficient.Theo de Raadt
ok mlarkin
2015-11-16Some minor tweaks:Martin Pieuchot
- Add $OpenBSD$ tag, - constify "struct cfattach", - Use <uvm/uvm_extern.h> rather than <uvm/uvm.h>, it's enough. - Keep the "struct vm" private. This allows us to not pull <uvm/uvm_extern.h> in <macine/vmmvar.h> - Prefer DPRINTF() for debug macro as dprintf(3) is a standard function name. - Add vmm_debug and fix VMM_DEBUG build - Remove unneeded <sys/rwlock.h> from <machine/vmmvar.h> - Kill whitespaces ok mlarkin@
2015-11-13vmm(4) kernel codeMike Larkin
circulated on hackers@, no objections. Disabled by default.
2015-11-10pmap changes required for vmm. Changes include addition of pm_type toMike Larkin
track type of pmap and various conversion and pte bit manipulation functions for EPT.
2015-11-09EPT paging permission bits for amd64, will be used in subsequent pmapMike Larkin
changes for vmm.
2015-10-30Fix interaction between inteldrm(4) and efifb(4). If we were booted by UEFIMark Kettenis
firmware and the efifb(4) framebuffer address matches one of the BARs associated with the inteldrm(4) device, make inteldrm(4) the console and prevent efifb(4) from attaching. Make sure that we do a full clear of the framebuffer when inteldrm(4) attaches to prevent the contents of the old framebuffer from showing up. Based on an earlier diff from yasuoka@ ok yasuoka@
2015-10-29Remove duplicated prototype.Miod Vallat
2015-10-05Fix efiboot not to use the usual kernel load address. Load the kernel inYASUOKA Masahiko
an allocated region and also move the stack to the end of the heap region. Then move the kernel to the usual place just before run the kernel, after calling ExitBootService(). report/test Toby Slight, Brian Conway
2015-09-30Use consistant whitespace/comments for #define'ing LABELSECTOR,Kenneth R Westerback
LABELOFFSET and MAXPARTITIONS. Easier on the eye when scanning through all these files. No functional change.
2015-09-30How about I delete _all_ the BITFIELDTYPE comments?Philip Guenther
2015-09-26lint is dead and C99 may be old enough to drive a car: delete LONGLONGPhilip Guenther
comments ok millert@
2015-09-26lint is dead: BITFIELDTYPE comments aren't usefulPhilip Guenther
ok miller@
2015-09-13Introduce intr_barrier(4), an interface that guarantees that an interruptMark Kettenis
handler that was running has finished. ok miod@, guenther@ (both for the equivalent sparc64 diff)
2015-09-02remove a bunch of orphaned prototypes and unused functions; ok miodMike Belopuhov