summaryrefslogtreecommitdiff
path: root/sys/arch/i386
AgeCommit message (Collapse)Author
2019-08-04Fix a typo I noticed reviewing the smbios code cleanup diff.kmos
(stirng -> string) ok kettenis@ who pointed out I should fix the new arm64 smbiosvar.h too
2019-08-04Cleanup the bios(4)/smbios(4) code a bit. Fix some KNF issues, reduceMark Kettenis
differences between the i386 and amd64 versions of the code and switch to using the standard C integer exact width integer types. ok deraadt@
2019-08-04crank version, following fchmod changeTheo de Raadt
2019-08-03In the bootblocks, after discovering and opening /bsd.upgrade, fchmod -xTheo de Raadt
so the file cannot be re-executed upon the next boot. This provides a stronger one-shot-upgrade model than the upgrade script's rm /bsd.upgrade. Now various forms of upgrade failure will reboot into /bsd, which is probably more recoverable. Performing fchmod -x depends on (1) use of MI boot.c (not alpha/macppc/sparc64/sgi/octeon) and (2) "can write blocks" functionality in the IO layer. Most architectures have this support now. Two diagnostics "fchmod a-x %s: failed" and "/bsd.upgrade is not u+x" will remain in the tree while refinements happen for some of the laggard architectures. based upon a discussion florian tested in snapshots for more than a week without any complaints
2019-07-26emove duplicate definitions of LAPIC_ID_MASK and LAPIC_ID_SHIFT.Kevin Lo
"yes please" guenther@
2019-07-24Avoid strlcpy() and printing of bios date if fixstring() returns NULL.Jonathan Gray
jan@ has a machine where the smbios date is ten space characters which results in fixstring() returning NULL causing a NULL derefence. Reported, tested by and ok jan@
2019-07-15store smbios date string in globally visible var for drmJonathan Gray
ok mlarkin@ kettenis@
2019-07-09I wrote the pc-page-writeable and sp-not-MAP_STACK code to be shared, andTheo de Raadt
then ran into the messaging being poor. Then I fixed the messages. But there are two sub-cases of sp-not-MAP_STACK -- one at syscall time, and another at regular userland trap (on some architectures), and I bungled that messaging. Correct that now, while I look for yet another better way... discovered by millert, who ran an pre-MAP_STACK binary.
2019-06-28Write back and invalidate caches before updating CPU microcode,Alexander Bluhm
like Intel does in their patches on githup. Also add a compiler level memory barrier to the wbinvd instruction like Linux does. OK mlarkin@ guenther@ kettenis@
2019-06-21Further improve the filesystem stability of kernel installation by KARL.Theo de Raadt
Use install -F to instead of cp, for fsync(2). Coupled with the new sync(8) in the reorder_kernel script, the window for a incomplete /bsd file on-disk due to a crash has now shrunk substantially. Discussion with kettenis, millert and tedu
2019-06-14Add TSC_ADJUST CPUID flag.Mark Kettenis
ok deraadt@, mlarkin@
2019-06-11Remove unused scheduler related definitions.Martin Pieuchot
ok visa@
2019-06-10Use PWAIT instead of PUSER in tsleep(9).Martin Pieuchot
It doesn't matter in this case and reducing the number of PUSER makes the scheduler logic easier to understand. ok kettenis@, visa@
2019-06-08When loading intel microcode in the non-efi case, error if the file isJonathan Gray
larger than 256KB not 128KB to cope with the 06-8e-09 microcode which is currently 193KB. Reported and tested by Paul de Weerd. Matches a diff from claudio@
2019-06-01Refactor the MAP_STACK feature, and introduce another similar variation:Theo de Raadt
Lookup the address that a syscall instruction is executed from, and kill the process if that page is writeable. This brings an aspect of W^X behaviour to W|X mappings (in JITs not yet adapted to W^X). The goal is to remove simple attack methods and force use of ret2libc or other more complicated means. ok kettenis stefan visa
2019-05-28Enable virtio again since the compilation problems have been fixed.Stefan Fritsch
ok deraadt@
2019-05-27disable virtio. a serially careless & procedure violating developerTheo de Raadt
has broken the tree once again. ok kettenis
2019-05-23zap reference to non-existent function in a commentJasper Lievisse Adriaanse
ok mpi@
2019-05-22i386/amd64 apm(4): Ignore APM_UPDATE_TIME events.cheloha
The APM spec defines an APM_UPDATE_TIME event that is meant to cause the driver to rebase the system's wallclock against the RTC. The event itself is apparently caused by occasional blackout periods where interrupts cannot be delivered, which might cause the system to miss a tick. The problem is that on systems where these events are frequent this constantly erodes the system wallclock. The RTC is not the greatest clock in the world so these systems are always playing catch-up. ntpd(8) is a far better clock corrector than rebasing against the RTC, so it should be safe to simply ignore the event. We continue to record the event for userspace listeners, but we do not call inittodr(9) on receipt of the event. Linux has ignored the event since v2.6.21: https://github.com/torvalds/linux/commit/c1d370e167d66b10bca3b602d3740405469383de#diff-d85b9a44da8e5dfb2fb1bcbd304c2a6c Discovered by jcs@. Discussed a bit with jcs@, tedu@, deraadt@. Fix tested by jcs@. "I think we should ignore the event" deraadt@
2019-05-08Enable ucrcom(4) on all architectures that have uslcom(4).Mark Kettenis
ok deraadt@
2019-05-05Getting too tight. Surrender a littleTheo de Raadt
2019-05-04Improve the interaction between efifb(4), inteldrm(4) and radeondrm(4)Mark Kettenis
when we have a serial console by introducing the notion of a "primary" graphics device. The primary graphics device is the one set up and used by firmware (BIOS, UEFI). The goal is to make sure that wsdisplay0 and drm0 reliably attach to the primary graphics device such that X works out of the box even if you have multiple cards or if you are using a serial console. This also fixes the situation where inteldrm(4) or radeondrm(4) would take over the console on UEFI systems even if the kernel was booted with a serial console. ok jsg@
2019-04-20libsa's memcpy() is actually memmove(). make a proper memmove(), and giveTheo de Raadt
memcpy() correct behaviour. This also brings the bcopy() macro into line.
2019-04-14Instead of using COPTS=-Oz (and similar) in make environment to forceTheo de Raadt
tightly-built ramdisk kernels, set the option in per-arch Makefile.inc based upon SMALL_KERNEL
2019-04-14Update shared drm code, inteldrm(4) and radeondrm(4) from linux 4.4 toJonathan Gray
linux 4.19.34. Adds support for more Intel hardware: Broxton/Apollo Lake (was is_preliminary in 4.4) Amber Lake (another Kaby Lake refresh) Gemini Lake Coffee Lake Whiskey Lake Cannon Lake (though no hardware with Intel graphics ever shipped) Ice Lake (alpha support, hardware not released) This does not add support for new radeon hardware on the AMD side as newer radeons have a different kernel driver (amdgpu). Thanks to the OpenBSD Foundation for sponsoring this work, kettenis@ for helping and a bunch of other developers for testing.
2019-04-10crank versionsTheo de Raadt
2019-04-10change marks[] array to uint64_t, so the code can track full 64-bitTheo de Raadt
details from the ELF header instead of faking it. Proposal from mlarkin, tested on most architectures already
2019-04-08crank version; looks good deraadtFlorian Obser
2019-04-01fast track ddb> reboot command to skip anything which might panic again.Ted Unangst
ok deraadt
2019-03-23Use the debugger mutex for `ddb_mp_mutex'. This should prevent a raceVisa Hankala
that could leave `ddb_mp_mutex' locked if one CPU incremented `db_active' while another CPU was in the critical section. When the race hit, the debugger was unable to resume execution or switch between CPUs. Race analyzed by patrick@ OK mpi@ patrick@
2019-03-22umbg now supports DCF600USB as well; adjust comment. from weerd@Stuart Henderson
2019-03-07Return early in ucode loading if cpuid is not available. Should fixJonathan Gray
booting on 486s without cpuid. Reported by Falk Richter and diagnosed by guenther@
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@