summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
AgeCommit message (Collapse)Author
2017-04-30Unifdef KGDB.Martin Pieuchot
It doesn't compile und hasn't been working during the last decade. ok kettenis@, deraadt@
2017-04-28add some comments. no functional changeMike Larkin
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-27use a more descriptive value from the VEI_DIR_xxx enum instead of aMike Larkin
hardcoded number. 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-04-26Convert some hardcoded function names in printfs into %s / __func__.Mike Larkin
Some of these pointed out by Michael W. Bombardieri, I went through the file and fixed the rest. No functional change.
2017-04-26Fix a typo relating to savefpu alignmentMike Larkin
ok kettenis
2017-04-20Tweak lock inits to make the system runnable with witness(4)Visa Hankala
on amd64 and i386.
2017-04-20Hook up mutex(9) to witness(4).Visa Hankala
2017-04-20Hook up mplock to witness(4) on amd64 and i386.Visa Hankala
2017-04-20Add routines for saving stack traces and printing saved tracesVisa Hankala
on amd64 and i386. With guenther@
2017-04-16Replace fetch_and_add() with atomic_inc_int_nv() from <sys/atomic.h>Visa Hankala
to make the code more similar to sparc64's. OK mpi@, guenther@, kettenis@
2017-04-14SVM: calculate max ASID value and save for later use. This will be used inMike Larkin
an upcoming diff to handle ASID/VPID reuse/rollover.
2017-04-13Provide mips64 with kernel-facing TCB_{GET,SET} macros that store itPhilip Guenther
in struct mdproc. With that, all archs have those and the __HAVE_MD_TCB macro can be unifdef'ed as always defined. ok kettenis@ visa@ jsing@
2017-04-02Filter out RDTSCP, needed to handle solaris guests. We set the VMX controlMike Larkin
to enable RDTSCP to 0, so when solaris attempted to use the instruction (since it wasn't filtered out of CPUID information), the CPU issued an #UD exception.
2017-03-28Properly handle VMX entry controls governing guest processor mode.Mike Larkin
Before seabios, this didn't matter much but now it does since various bootloaders/kernels need such treatment. ok deraadt
2017-03-28add RDTSCP flags to identcpu.cMike Larkin
ok guenther, deraadt
2017-03-27typo in debug buildMike Larkin
2017-03-27add a newline to an error printfMike Larkin
2017-03-27hibernate_free() should not be called from MD code, acpi_sleep_state()Theo de Raadt
unwinds that. Upon hibernate fail, this was a collection of double-frees.. ok claudio mlarkin
2017-03-26KNFJeremie Courreges-Anglas
2017-03-26discard MSR reads from unknown MSRs instead of passing them through. ThatMike Larkin
behaviour was needed during early development but not anymore. Suppress the printf that accompanied these exits since linux guests go probing wildly into msr-land on each boot. ok deraadt
2017-03-26Add "AVX" to the comment above the previous commit. Spotted by reykMike Larkin
2017-03-26Suppress AVX from the extended CPUID flags. Our AVX treatment is currentlyMike Larkin
incomplete and enabling it leads ubuntu guests to try and use the feature, with incorrect results. We can re-enable this at a later date when AVX is properly handled.
2017-03-25Split vmm_probe() into a vmm_enabled() function, to better follow theTheo de Raadt
probe/attach approach used by mainbus. ok mlarkin kettenis
2017-03-25Use explicit operand with SVM instructions as clang doesn't recognize theMark Kettenis
implicit form. ok mlarkin@
2017-03-24Handle guest interruptibility state - Reset the interruptibility stateMike Larkin
VMCS field on vmentry when we advanced %rip on the last exit (simulating a real processor's behaviour). Handles guest "sti ; hlt" instruction sequences, which is used in seabios as a primitive idle loop construct.
2017-03-24Exit to vmd on byte size PCI accesses.Mike Larkin
2017-03-24Allow returns from vmd after handling cpuid exits (handles the case whereMike Larkin
a cpuid instruction was emulated at the same time there was an interrupt pending)
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-03-21Don't allow the guest to clear CR0_NE or CR4_VMXE. While we should beMike Larkin
using the "must be clear / must be set" masks for these registers, I'd like to know (for now) when guest VMs manipulate bits in these registers in an unexpected way. This is needed for Linux guests, as they unconditionally set CR0 without NE, and CR4 without VMXE.
2017-03-21CPUID feature 0x80000000 emulation fell through to 0x80000001, whichMike Larkin
resulted in wrong cpu information being passed to the guest. Specifically this breaks Linux guests as with the fallthrough, CPUID_LONG was cleared, and Linux thought it was runinng on a machine incapable of 64-bit mode. OpenBSD/NetBSD guests don't check this flag and thus weren't affected.
2017-03-19Handle master/slave PIC vector base properly. OpenBSD uses 0x20/0x28Mike Larkin
(respectively). Seabios uses 0x8/0x78 and linux uses 0x30/0x38. Respond properly to PIC vector base assignment and calculate VMX injection vectors based on current values, instead of always assuming OpenBSD defaults. Needed for both seabios serial console support as well as linux guest support. Tested on -current as is, does not break existing OpenBSD guest support.
2017-03-16Typo, from miod@Martin Pieuchot
2017-03-15Fix building profiling kernels by passing the -p flag to config(8)Theo Buehler
if the kernel's name ends in .PROF. problem reported by jmc via mpi ok mpi
2017-03-12enable acpisbsJoshua Stein
2017-03-11Introduce a new knob to force the first USB keyboard as console input.Martin Pieuchot
By setting "machdep.forceukbd=1" you can now use your USB keyboard in ddb(4) even if your BIOS emulates a pckbd(4). ok tom@, kettenis@, deraadt@
2017-03-07Keep on trying to grab the lock after leaving ddb after lock spin-out.Visa Hankala
This restores the behaviour that preceded ticket locks. The feature can be useful in some debug cases where the system is not totally borken. OK guenther@, dlg@, mpi@
2017-03-07Use the pause instruction on the slow path. This improvesVisa Hankala
performance a bit. OK mikeb@, kettenis@, mpi@, tom@, mlarkin@
2017-03-07Make the slow path similar to i386's by checking mutex ownerVisa Hankala
on every iteration. OK mikeb@, kettenis@, mpi@, tom@, mlarkin@
2017-03-07Disallow setting machdep.lidaction to any other value but [0,2].Martin Natano
suggested by halex ok deraadt millert
2017-03-05Teach the ddb disassembler about most of the vm* instructionsPhilip Guenther
ok mlarkin@
2017-03-03Whan an amd64 machine got an NMI, the current process in user landAlexander Bluhm
was killed with SIGBUS. Better drop to ddb regardless wether a user process is currently scheduled or not. NMI signals hardware failure or a debug button. The code in i386 trap() has always been that way. The switch in db_ktrap() must also not depend on the fact wether kernel or user land is running. OK deraadt@
2017-03-03Delete "comspeed" which had been mistakenly added as a int value.YASUOKA Masahiko
2017-03-02Add a new sysctl machdep.lidaction. The sysctl works as follows:Martin Natano
machdep.lidaction=0 # do nothing machdep.lidaction=1 # suspend machdep.lidaction=2 # hibernate lidsuspend is just an alias for lidaction, so if you change one, the other one will have the same value. The plan is to remove machdep.lidsuspend eventually when people have upgraded their /ets/sysctl.conf. discussed with deraadt, who came up with the new MIB name no objections mlarkin ok stsp halex jcs
2017-03-02log attempts to access cpuid leaf function 0x03, "processor serial number".Mike Larkin
matches other log messages for other unimplemented cpuid leaf functions.
2017-03-02reduce some more differences in vmm between i386 and amd64 that didn'tMike Larkin
get picked up previously. i386 gets some changes relating to EFER treatment and amd64 gets a whitespace fix.
2017-03-02reduce differences in vmm between amd64 and i386 (i386 picks up a handfulMike Larkin
of recent fixes for SVM that were missed). No functional change on amd64 (just an added comment)
2017-03-02Refactor cpuid exit handler to make it easier to bolt on SVM supportMike Larkin
shortly (instead of having two nearly identical functions.) ok reyk