summaryrefslogtreecommitdiff
path: root/sys/arch
AgeCommit message (Collapse)Author
2018-08-25Add umt(4) for USB Windows Precision Touchpad devicesJoshua Stein
Based on imt(4) Rename HIDMT_INPUT_MODE_MT to HIDMT_INPUT_MODE_MT_TOUCHPAD ok deraadt
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-25Insert new child nodes at the end.Mark Kettenis
ok patrick@
2018-08-25As Intel(TM) cpus are discovered to have more bugs, more workaround MSRsTheo de Raadt
are added. Presence of such MSRs is indicated with a feature flag, which we probe and print at startup for each AP CPU. EFI screen scrolling hasn't gotten faster (yet) and 9600 baud serial console is still the same speed as 1980. Final piece of the puzzle is machines have more cpus, providing more opportunity for screen scrolling and serial fifo's to fill up. The BSP cpu is watching the AP cpus probe and print, but increased latency causes it to exceed a timeout and print "cpuXX: failed messages". Crank that timeout. discussed with kettenis, ok guenther
2018-08-25Don't treat UnicodeChar == 0 as a keyboard input. The same fix wasYASUOKA Masahiko
done on amd64 already. Original diff from Frank Groeneveld ok tb patrick
2018-08-24print cpu family/model/stepping in dmesgJonathan Gray
discussed with deraadt@ bluhm@ and sthen@
2018-08-24Don't treat UnicodeChar == 0 as a keyboard input.YASUOKA Masahiko
This fixes the problem that which prevents typing the passpharase for softraid on boot. It happened at least with some external keyboards on ThinkPad X2{6,8}0. diff from Frank Groeneveld ok tb
2018-08-23Set the pointer to the EFI Runtime Services, otherwise we call intoPatrick Wildt
nowhere. ok kettenis@
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-22Adding membar_xxx defines to userland.Kenji Aoyama
The src/lib/libc/thread/rthread.c 1.8 change adds #include <sys/atomic.h> in userland code. Current m88k atomic.h contents are inside of #if defined(_KERNEL) guard, then, nothing is defined for userland program. So we need adding some defines to compile it on m88k. The original diff is suggested from Miod Vallat, modified by the advice from mpi@ and kettenis@. ok kettenis@
2018-08-21Perform mitigations for Intel L1TF screwup. There are three options:Theo de Raadt
(1) Future cpus which don't have the bug, (2) cpu's with microcode containing a L1D flush operation, (3) stuffing the L1D cache with fresh data and expiring old content. This stuffing loop is complicated and interesting, no details on the mitigation have been released by Intel so Mike and I studied other systems for inspiration. Replacement algorithm for the L1D is described in the tlbleed paper. We use a 64K PA-linear region filled with trapsleds (in case there is L1D->L1I data movement). The TLBs covering the region are loaded first, because TLB loading apparently flows through the D cache. Before performing vmlaunch or vmresume, the cachelines covering the guest registers are also flushed. with mlarkin, additional testing by pd, handy comments from the kettenis and guenther peanuts
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-21If a kernel thread was created by a user land system call, the userAlexander Bluhm
land FPU context was saved to proc0. This was an information leak as proc0 is used to initialize the FPU at exec and signal handlers. Never save the FPU to proc0, it has the initialization value. Also check whether the FPU has valid user land state that has to be forked. This bug is a regression from the eager FPU commit. OK guenther@
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-20Implement bus_space_mmap(9).Mark Kettenis
ok patrick@
2018-08-20Remove unused spllock().Visa Hankala
OK deraadt@ mpi@
2018-08-19delete blank line not found in other archTheo de Raadt
2018-08-19pseudo-device must be file-flagged otherwise ramdisks cannot link.Theo de Raadt
2018-08-19Implement "mach dtb <filename.dtb>" in efiboot(8). This way we canPatrick Wildt
provide our own FDT if the BIOS doesn't supply one, or even override the supplied one. Idea from and ok kettenis@
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-18Add support for flushing the instruction cache of other processes. This isMark Kettenis
needed for inserting and removing breakpoints through ptrace(2). The approach here only works for CPUs that have a PIPT instruction cache as we use aliased mappings to invalidate the instruction cache. That doesn't work on CPUs that have a virtually indexed instruction cache. ok deraadt@, visa@
2018-08-18Make sure we don't match (and attach) more than the maximum number ofMark Kettenis
supported CPUs. ok deraadt@, patrick@, visa@
2018-08-18Support arbitrary number of redistributors.Mark Kettenis
Inspired by an earlier diff from drahn@ ok patrick@, jsg@
2018-08-16Make pmap_allocate_asid() mpsafe. Since between checking the ASIDPatrick Wildt
table and setting the bits atomically another core can select the same ASID as we did it currently would not be safe to run it without the kernel lock. This replaces the atomic_setbits_int(9) call with atomic_cas_uint(9) where we can check that the table entry has not been changed since we evaluted it. Also modify pmap_free_asid() to use the same concept. ok kettenis@
2018-08-15Turns out the integration of the GIC-500 on the Rockchip RK3399 is busted.Mark Kettenis
It treats all access to the memory mapped registers as "secure" even if we're running in non-secure mode. As a result, during bringup of OpenBSD on the RK3399, I got confused and tweaked the interrupt priorities in a way that is wrong (but worked on the RK3399. Fix those priorities to match what they should be according to the documentation (and works on other hardware that includes a GICv3) and add code that detects the broken RK3399 GIC and adjusts the priorities accordingly. Also remove (broken) code that tries to mess around with group 0 interrupts and fix setting bits in the GICD_CTLR register on the broken RK3399 GIC.
2018-08-15Distinguish between softc array members that are indexed by redistributorMark Kettenis
and those that are indexed by the assigned CPU (unit) number. Fix the shuffling of the affinity fields are shuffled around to match the spec.
2018-08-15Use atomic instructions to keep track of what ASIDs are in use. This makesMark Kettenis
pmap_free_asid() and therefore pmap_destroy() mpsafe which is important since we might end up calling that function without holding the kernel lock as a result of releasing a reference in pmap_page_protect(9). ok visa@
2018-08-15add cpuid and msr bits fromJonathan Gray
'Deep Dive: CPUID Enumeration and Architectural MSRs' ok deraadt@
2018-08-14spelling errorTheo de Raadt
2018-08-12Add retguard macros for arm64 asm and apply them in the straightforwardmortimer
cases in kernel and libc. ok deraadt@
2018-08-11Make legacy interrupts work in more cases.Mark Kettenis
2018-08-11Use IORT table to map requester ID into MSI sideband data.Mark Kettenis
2018-08-11Make GICv3 redistributor support actually work and add ITS support.Mark Kettenis
2018-08-11Bump MAXCPUS from 8 to 24.Mark Kettenis
ok jsg@
2018-08-11Fix a couple of bugs in the ITS support code:Mark Kettenis
- Don't dereference sc_prop if we're not handling an LPI. Fixes a crash on qemu when emulating a GICv3 without ITS (and therefore no LPIs(. - Use the true IPL when calculating the priority of an LPI. The old code used a variable that still had the IPL_MPSAFE flag in it. - Write to the right GITS_BASERn instead of ialways writing to GITS_BASER0. - Flush the cache after initializing/modifying the in-memory tables. The GICv3 on the SynQuacer isn't fully coherent and only supports the "non-shareable" attribute for its in-memory tables. So we have to flush the cache to the point of coherency to guarentee that the GIC sees our changes to those tables. Throw in a full memory barrier for good measure. Also add support for the SynQuacer pre-ITS. ok jsg@, patrick@
2018-08-11Use MAXCPUS as the number of elements for the array of per-cpu data.Mark Kettenis
ok jsg@, patrick@
2018-08-11Use MAXCPUS as the number of elements for the array of per-cpu data.Mark Kettenis
Fixes machines with more than 8 cores. ok jsg@, patrick@
2018-08-10crank to 6.4-betaTheo de Raadt
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-09Synopsys Designeware PCIe IP isn't 100% ECAM compliant. It doesn't handleMark Kettenis
type 0 configuration requests correctly which results in devices on bus 0 appearing multiple times. Fix this by adding a quirk and match the appropriate compatible string. ok jsg@, patrick@
2018-08-09Define __HAVE_ACPI on arm64 and __HAVE_FDT on arm64, armv7 and octeonPatrick Wildt
so that we can include firmware-dependant code in generic drivers to be able to extract metadata information like MAC addresses and out-of-band interrupts from the ACPI/FDT tables. ok kettenis@
2018-08-08Support DMA coherent devices that attach to mainbus(4) as well.Mark Kettenis
ok patrick@
2018-08-08Fix the ITLinesNumber mask and bump the number of supprted redistributorsMark Kettenis
up to 24. ok patrick@
2018-08-08Extend the FDT interrupt API to support masking and unmasking IRQs.Patrick Wildt
Discussed with kettenis@
2018-08-08r1.19 removed a bunch of code, but not enough, and left dead code around.kn
From Miod Vallat, "Go ahead" kettenis