summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
AgeCommit message (Collapse)Author
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
2017-03-01Don't try to access the com(4) hardware to set up the console speedPatrick Wildt
on efiboot(8), as it can crash the EFI application. ok tom@
2017-03-01Fix the code which preserves the device path of the loaded image ifYASUOKA Masahiko
booting from a disk. It had a typo. Also tweak the code which finds the blkio of the boot disk to show how it is matching the device path nodes clearly. found by and discussed with patrick@.
2017-02-28Switch geteblks()'s size argument from int to size_t. It's called withMartin Natano
unsigned variables as argument in most places anyway. Decrease the chance of signedness/range mismatch issues. ok stefan
2017-02-22add acpisbs, an acpi smart battery subsystem driver reading dataJoshua Stein
over smbus currently disabled because it conflicts with acpibat ok deraadt, kettenis
2017-02-20VMX: assert that the supplied instruction length matches what is expected forMike Larkin
HLT exits
2017-02-20SVM: asm support for SVM/RVIMike Larkin
2017-02-20typo in commentMike Larkin
2017-02-20SVM: fix wrong treatment of MSRs, especially EFER.Mike Larkin
2017-02-20SVM: fix segment A/R bits formattingMike Larkin
2017-02-14Set the default TSC quality to -1000 to be less than the i8254Reyk Floeter
This makes sure that TSC is not used if we really don't want to. The kernel bumps the quality to 2000 for constant invariants TSCs on latest CPUs only. OK mikeb@
2017-02-12Split up fork1():Philip Guenther
- FORK_THREAD handling is a totally separate function, thread_fork(), that is only used by sys___tfork() and which loses the flags, func, arg, and newprocp parameters and gains tcb parameter to guarantee the new thread's TCB is set before the creating thread returns - fork1() loses its stack and tidptr parameters Common bits factor out: - struct proc allocation and initialization moves to thread_new() - maxthread handling moves to fork_check_maxthread() - setting the new thread running moves to fork_thread_start() The MD cpu_fork() function swaps its unused stacksize parameter for a tcb parameter. luna88k testing by aoyama@, alpha testing by dlg@ ok mpi@
2017-02-10Unbreak 'config -p'.Martin Pieuchot
ok tb@, jca@
2017-02-08In exec_elf.c: expand ELFNAME(), ELFNAME2(), and ELFNAMEEND() exceptPhilip Guenther
leaving out the size, so that ELFNAME2(exec,makecmds) becomes exec_elf_makecmds instead of exec_elf{32,64}_makecmds and then delete the ELFNAME2() and ELFNAMEEND() macros. Move the prototypes for functions local to exec_elf.c to there from exec_elf.h. Simplify the SMALL_KERNEL conditionals around the ELF coredump code. Change exec_conf.c to use the size-generic names and macros Remove exec_elf{32,64}.c and just build exec_elf.c; delete the _KERN_DO_ELF and _KERN_DO_ELF64 #defines. ok jca@, encouragement from deraadt@ and tom@