summaryrefslogtreecommitdiff
path: root/sys/arch/i386
AgeCommit message (Collapse)Author
2019-02-02Improve stack trace saving on i386:Visa Hankala
* Replace unnecessary use of db_get_value() with direct access of f_retaddr. The trace function assumes that the chain of frames is good in terms of alignment and content. * Replace the for loop with a while loop and drop the check "frame != NULL" from the loop condition. The check is redundant with the "!INKERNEL(frame)" condition. The code already assumes that the initial frame is valid. * Stop iteration if f_retaddr is a non-kernel address in order to not save a user address at the end of the trace. This additionally fixes a kernel crash that would happen if the user thread had a broken frame pointer. OK mpi@
2019-01-22flense more trailing whitespacePeter Hessler
2019-01-22remove trailing whitespace in the Laptop Package part of the license text.Peter Hessler
no words or punctation were modified.
2019-01-20Add support for a new kcov trace mode called KCOV_MODE_TRACE_CMP whereanton
comparison instructions and switch statements are being traced. This mode will be used during fuzzing to generate even more coverage. The same mode is also supported by FreeBSD and Linux. Thanks to jmc@ for improving the manual bits. ok bluhm@ visa@
2019-01-19Add a pwraction sysctl that controls what the power button does on acpi.Ted Unangst
By default, nothing changes -- shutdown is initiated. But allows turning power button into a sleep button if desired. (grudging) ok from a few parties
2019-01-18delete vmm(4) in i386pd
We will still be able to run i386 guests on amd64 vmm. Reasons to delete i386 vmm: - Been broken for a while, almost no one complained. - Had been falling out of sync from amd64 while it worked. - If your machine has vmx, you most probably can run amd64, so why not run that? ok deraadt@ mlarkin@
2019-01-07Extents code has its own set of flags and does not use malloc's.Alexander Bluhm
The code in pci_init_extents() accidently passed M_NOWAIT which is EX_FAST and does no harm. Replace it with EX_NOWAIT. from Christian Ludwig; OK kettenis@
2019-01-02markup boot prompt commands using Ic, not Nm; ok jmc@anton
2018-12-16Avoid using a too big bounce buffer by splitting up large reads. AllowsOtto Moerbeek
for booting using large (64k) blocksize filesystems. ok tedu@
2018-12-10Ensure that we close the file descriptor after loading microcode.Joel Sing
Otherwise we end up keeping file descriptor and inode related buffers around, that are unnecessarily consuming memory. ok deraadt@ patrick@
2018-12-10Do not call free on a non-allocated pointer.Joel Sing
ok deraadt@
2018-12-05Include srp.h where struct cpu_info uses srp to avoid erroring out whenJonathan Gray
including cpu.h machine/intr.h etc without first including param.h when MULTIPROCESSOR is defined. ok visa@
2018-11-23Add the pvclock(4) guest driver for paravirtual clocksReyk Floeter
This improves timekeeping on KVM guests as it runs much better than the virtualized acpihpet or acpitimer timecounters and the invtsc is not always available. Many thanks to Janne Johansson, landry@, and benno@ for testing amd64/i386. OK mlarkin@ phessler@
2018-10-30The way we currently generate gap.o using a linker script results in .rodataMark Kettenis
and .data segments that have the X (executable) flag set when using lld. This doesn't result in those sections being mapped executable in the bsd kernel, but it does result in the X flag being set on those sections in the final kernel binary, which confuses some scanning tools for (ROP) gadgets. Fix this by tweaking the generated gapdummy.c file that is used for building gap.o. It now defines the .rodata section using inline asm. This also fixes .data as it will inherit its flags from .rodata. ok deraadt@, mortimer@
2018-10-26With lld the calculation of the entry point was wrong sinceChristian Weisgerber
LOADADDR(.text) is only available after the description of the text section. Instead simply use ENTRY(start) like we do on amd64. The bootloader strips the high bits from the entry point address already, so using the virtual address as the entry point address works. with/ok kettenis@
2018-10-26Correct linker emulation name for lld when building i386 kernels on amd64.Christian Weisgerber
ok kettenis@
2018-10-23Comvert a few uvm_km_alloc(9) and uvm_km_valloc(9) calls to km_alloc(9).Mark Kettenis
ok deraadt@, mlarkin@, visa@
2018-10-16Add linker script to assis lld with building something usable that doesn'tMark Kettenis
have a PT_GNU_STACK segment and doesn't pad the bootblocks to a full page. ok naddy@, help from guenther@
2018-10-16Add gapdummy logic (already used on other archs) to allow linking with lld.Christian Weisgerber
ok jsg@ phessler@ kettenis@ deraadt@
2018-10-02Unify the MD byteswapping code as much as possible across architectures.Christian Weisgerber
Use inline functions instead of GNU C statement expressions, and make them available to userland. With clues from guenther@. ok guenther@ kettenis@
2018-09-12Move -Wno-address-of-packed-member to the clang block as well and syncJonathan Gray
armv7 and i386 with amd64. ok guenther@
2018-09-11Add defines for amd microcode msrs which appear to be present since k8Jonathan Gray
though amd only provides public redistributable updates for >= family 10h.
2018-09-06fix whitespaceJonathan Gray
2018-08-31Move kcov device definitions into <sys/conf.h>.Visa Hankala
OK anton@ deraadt@ kettenis@ mpi@
2018-08-29First pass in bringing i386 in sync with amd64. This does not yet work, but ispd
being committed now so we can work on the rest in-tree. ok mlarkin@
2018-08-27move bwfm* at pci? to the wireless sectionJoshua Stein
2018-08-25Define __HAVE_ACPI.Mark Kettenis
ok deraadt@, krw@, jca@
2018-08-25Fix printing of ioapic remapping messages; avoid printing duplicate info.Mark Kettenis
ok deraadt@
2018-08-24print cpu family/model/stepping in dmesgJonathan Gray
discussed with deraadt@ bluhm@ and sthen@
2018-08-23port the amd64 code for loading intel microcode on boot to i386Jonathan Gray
ok deraadt@ mlarkin@
2018-08-22Enable uscom(4) where uslcom(4) is already present.Martin Pieuchot
Based on a submisison from Jan Klemkow.
2018-08-21Rework kcov kernel config. Instead of treating kcov as both an option and aanton
pseudo-device, get rid of the option. Enabling kcov now requires the following line to be added to the kernel config: pseudo-device kcov 1 This is how pseudo devices are enabled in general. A side-effect of this change is that dev/kcov.c will no longer be compiled by default. Prodded by deraadt@; ok mpi@ visa@
2018-08-21print rdtscp and xsave_ext cpuid bits on i386 as wellJonathan Gray
move printing of ecxfeatures bits to match amd64
2018-08-21print sefflags_edx cpuid bits on i386 as wellJonathan Gray
2018-08-20Remove unused spllock().Visa Hankala
OK deraadt@ mpi@
2018-08-19pseudo-device must be file-flagged otherwise ramdisks cannot link.Theo de Raadt
2018-08-19Add kcov(4), a kernel code coverage tracing driver. It's used in conjunctionanton
with the syzkaller kernel fuzzer. So far, 8 distinct panics have been found and fixed. This effort will continue. kcov is limited to architectures using Clang as their default compiler and is not enabled by default. With help from mpi@, thanks! ok kettenis@ mpi@ visa@
2018-08-19Add support for multiple PCI segments. Only really implemented for arm64Mark Kettenis
for now as amd64/i386 firmware still caters for legacy OSes that only support a single PCI segment. ok patrick@
2018-08-15add cpuid and msr bits fromJonathan Gray
'Deep Dive: CPUID Enumeration and Architectural MSRs' ok deraadt@
2018-08-10Bump boot loader versions for softraid passphrase handling change.Joel Sing
2018-08-10Retry on incorrect passphrase for softraid crypto boot.Joel Sing
Historically, the softraid crypto support in the boot loaders has only given one attempt to provide the correct passphrase. There were a few reasons for this, including the fact that pkcs5_pbkdf2() allows an empty passphrase and that returning EPERM allowed for another attempt. With the event of KARL and the need for bsd.booted with hibernate resumption, this becomes much more of an issue - if you get the passphrase wrong you fail to resume. There are also other situations like using /etc/boot.conf to switch serial console, but an incorrect passphrase results in the config not being read. Also, bcrypt_pbkdf() does not permit empty passphrases. This reworks the softraid crypto support in the boot loaders so that it loops requesting a valid passphrase until one is provided, or an empty passphrase is entered (at which point it will abort). ok mortimer@ tb@
2018-08-08Recognise 'Speculative Store Bypass Disable' support cpuid bit.Jonathan Gray
Documented in 'Speculative Execution Side Channel Mitigations' revision 2.0.
2018-08-03Add mue(4), a driver for Microchip LAN75xx/LAN78xx 10/100/1000 USB EthernetKevin Lo
adapters. "go ahead commit it" deraadt@
2018-08-01On AMD CPUs, If the LFENCE serialization MSR bit is already set, thenBryan Steele
we don't need to uncondtionally set it. Worksaround a suspected bug in newer Linux KVM, which may trigger a #GP fault on writes to this MSR. ok mlarkin@
2018-07-30Use the MI interrupt enable/distable API instead of the MD one on i386 andMark Kettenis
remove the MD API. ok deraadt@
2018-07-24Do the same for i386 as amd64:Bryan Steele
Add "Mitigation G-2" per AMD's Whitepaper "Software Techniques for Managing Speculation on AMD Processors" By setting MSR C001_1029[1]=1, LFENCE becomes a dispatch serializing instruction. ok deraadt@
2018-07-13repair inconsistanciesTheo de Raadt
2018-07-12unbreak i386 build, thanks to pd@ for noticing. Same diff as I committedMike Larkin
earlier for amd64
2018-07-11Detect vmm(4) in the bootloader and automatically switch to the serialMike Larkin
console at 115200 baud. ok deraadt
2018-07-11adding __func__ identifier to panic() calls in vmm.c for amd64 and i386Nayden Markatchev
ok mlarkin@