summaryrefslogtreecommitdiffstats
path: root/sys/arch/i386 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Bump MAXTSIZ to 256MB on i386.kurt2021-03-161-2/+2
| | | | okay deraadt@
* Add acpi_iommu_device_map(), which replaces the DMA tag with one thatpatrick2021-03-151-1/+7
| | | | | | | | | is blessed with IOMMU magic, if available. This is mainly for arm64, since on amd64 and i386 the IOMMU only captures PCIe devices, as far as I know, which uses the pci_probe_device_hook(). This though is for non-PCI devices attached through ACPI. ok kettenis@
* spellingjsg2021-03-1114-29/+29
|
* Explicitly align kernel text.mortimer2021-03-071-2/+3
| | | | | | | lld11 no longer quietly aligns this when given an address, so we do the alignment explicitly. ok kettenis@
* ansijsg2021-03-062-6/+4
|
* remove some unused includesjsg2021-02-231-24/+0
|
* timecounting: use C99-style initialization for all timecounter structscheloha2021-02-234-29/+36
| | | | | | | | | | | | | | | | | | The timecounter struct is large and I think it may change in the future. Changing it later will be easier if we use C99-style initialization for all timecounter structs. It also makes reading the code a bit easier. For reasons I cannot explain, switching to C99-style initialization sometimes changes the hash of the resulting object file, even though the resulting struct should be the same. So there is a binary change here, but only sometimes. No behavior should change in either case. I can't compile-test this everywhere but I have been staring at the diff for days now and I'm relatively confident this will not break compilation. Fingers crossed. ok gnezdo@
* some phy are not needed anymore since the ethernet drivers went awayderaadt2021-02-161-6/+6
|
* Add uhidpp(4), a driver for Logitech HID++ devices. Currently limited toanton2021-02-041-1/+2
| | | | | | | | | exposing battery sensors for HID++ 2.0 devices. Most of the code is derived from the hid-logitech-hidpp Linux driver. Thanks to Ville Valkonen <weezeldinga at gmail dot com> for testing. ok mglocker@
* Again allow COPTS= to come from the environment again, and don't lose thederaadt2021-01-281-4/+4
| | | | | SMALL_KERNEL specific variations. ok espie jsg
* introduce ujoy(4), a restricted subset of uhid(4) for gamecontrollers.thfr2021-01-232-2/+5
| | | | | | | | This includes ujoy_hid_is_collection() to work around limitations of hid_is_collection() until this can be combined without fallout. input, testing with 8bitdo controller, and ok brynet@ PS4 controller testing, fix for hid_is_collection, and ok mglocker@
* Fold fitting sysctl_rdint into sysctl_bounded_arr in i386 cpu_sysctlgnezdo2021-01-091-11/+6
| | | | OK millert@
* Allocate pages for the F00F bug fix using km_alloc(9) instead ofjmatthew2021-01-061-2/+2
| | | | | | | uvm_km_zalloc(9). tested on qemu pretending to be a 586 ok bluhm@
* Allocate address space for reposting vga devices using km_alloc(9) ratherjmatthew2021-01-031-7/+9
| | | | | | than uvm_km_valloc(9). ok kettenis@
* Initialize pmap_kernel()'s mutexes.mpi2020-12-282-2/+6
| | | | | | | | | | Poison the IPL value of `pm_mtx' since it isn't supposed to be used and add an assert to make sure splraise() isn't called with a poisoned value. Fix a missing initialization found by WITNESS and reported by gnezdo@. ok millert@
* Enable acpihpet on install media, because otherwise clock initializationderaadt2020-12-272-4/+4
| | | | | is just too different from GENERIC or GENERIC.MP pointed out by jsg
* Refactor klist insertion and removalvisa2020-12-251-3/+3
| | | | | | | | | | | | Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists. Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification. OK mpi@
* Convert uvm_km_valloc(9) calls to km_alloc(9). Tested in qemu withjmatthew2020-12-201-3/+4
| | | | | | acpi disabled, no real mpbios hardware in sight. ok kettenis@
* Apply r1.86 of amd64 acpi_machdep.c to arm64 and i386, converting a fewjmatthew2020-12-191-3/+4
| | | | | | | uvm_km_valloc(9) to km_alloc(9). tested on arm64 by bluhm@, i386 by me ok kettenis@
* Use km_alloc(9)/km_free(9) instead of uvm_km_valloc(9)/uvm_km_free(9).kettenis2020-12-151-3/+3
| | | | | | | | These are the preferred interfaces and using them avoids tripping over a kernel lock assertion during early boot. Tested by bluhm@, sthen@ and Hrvoje Popovski. ok mpi@
* Geode CPU does not support SSE, so MXCSR does not exists there. Asbluhm2020-12-131-3/+2
| | | | | | | | our i386 compiler does not generate SSE instructions by default, it is not strictly necessary to save MXCSR content between setjmp(3) and longjmp(3). We do not want to end supporting such old processors now. Remove the stmxcsr and ldmxcsr instructions from libc. reported by Johan Huldtgren; OK jsg@ kettenis@
* fxp does not currently fitderaadt2020-12-091-2/+2
|
* Use daddr_t and not daddr32_t in boot media.krw2020-12-0911-22/+22
| | | | | | | | | | At a minimum, amd64/i386 should now boot from 4TB GPT formatted disks. More daddr32_t terminations with extreme prejudice to follow. Tested by various, in snaps for a few days. ok deraadt@
* Introduce constants to access the setjmp(3) jmp_buf fields frombluhm2020-12-061-2/+13
| | | | | | | i386 libc. The assembler code is more readable than with magic numbers. This brings i386 in line with amd64. No change in object file. OK kettenis@
* Since our IPI broadcast functions exclude the CPU doing the broadcast, wekettenis2020-11-281-1/+2
| | | | | | need to explicitly call wbinvd() in wbinvd_on_all_cpus(). ok jsg@, deraadt@
* In case of failure, call sigexit() from trapsignal instead of sensig().mpi2020-11-081-11/+7
| | | | | | | Simplify MD code and reduce the amount of recursion into the signal code which helps when dealing with locks. ok cheloha@, deraadt@
* refactor page-fault handling out of the trap() switch into user andderaadt2020-10-271-127/+158
| | | | | | | kernel functions, rearrange to be highly similar to amd64 fault handling, and reduce the KERNEL_LOCK to only be around uvm_fault reviewed by numerous people, especially kettenis In snaps for over a week
* xe(4) and mtd(4) are from a long gone eraderaadt2020-10-161-5/+4
|
* ef(4), give me a breakderaadt2020-10-161-2/+2
|
* use access_type as the PROT_* variable for uvm_fault() consistantlyderaadt2020-10-081-7/+7
| | | | ok kettenis
* an ugly white spacederaadt2020-09-241-2/+2
|
* the legacy need_resched macro to access per-cpu value is no longer neededderaadt2020-09-241-3/+1
| | | | ok kettenis
* mi_ast() should not use the old cpu, but the cpu (after potential sleepderaadt2020-09-241-2/+2
| | | | | in refreshcreds() ok kettenis
* Only perform uvm_map_inentry() checks for PROC_SP for userland pagefaults.deraadt2020-09-241-5/+5
| | | | | | | | This should be sufficient for identifying pivoted ROP. Doing so for other traps is at best opportunistic for finding a straight-running ROP chain, but the added (and rare) sleeping point has proven to be dangerous. Discussed at length with kettenis and mortimer. ok mortimer kettenis mpi
* When operating in NX mode, GUCODE_SEL can cover the entire userlandderaadt2020-09-244-22/+41
| | | | | | | | | address space permanently, and the line-in-the-sand manipulation T_PROTFLT|T_USER fixup handling can be skipped. This change was written to side-step the segment-descriptor mismanagement issues, commited recently for the "go on i386" tested by sthen ok kettenis guenther
* Make sure we fetch the CS limit of the CPU the trap happened on. It iskettenis2020-09-244-11/+16
| | | | | | | | | | | | | possible to switch CPUs when handling a trap since we need to lock the vm_map of the process. In that case the CS limit would be wrong an we incorrectly decide that there has been an execute privilige violation. Also make sure we only modify the variables that keep track of the CS limit and segment descriptor while holding the kernel lock. Fixes builds of go ports on i386. tested by sthen@ ok deraadt@
* shuffle "extern int cpu_pae" into cpu.h, as the number of users will soonderaadt2020-09-234-9/+6
| | | | | increase. ok kettenis
* oops incomplete variable rename prevented compile, hit by sthenderaadt2020-09-151-5/+5
|
* similar to fix by kettenis on amd64:deraadt2020-09-141-8/+6
| | | | | | | | | | | The uvm_map_inentry() check may sleep to grab the lock of the map. The fault address is read from cr2 in pageflttrap() which gets called after this check and if the check sleeps, cr2 is likely to be clobbered by a page fault in another process. Fix this by reading cr2 early and pass it to pageflttrap(). ok kettenis
* change pmap wbinvd use to wbinvd_on_all_cpusjsg2020-09-132-6/+6
| | | | | with this we can revert the recent coherency workaround in mesa ok deraadt@ kettenis@
* add an ipi for wbinvd and a linux style wbinvd_on_all_cpus() functionjsg2020-09-134-6/+35
| | | | ok kettenis@ deraadt@
* add SRBDS cpuid bitsjsg2020-09-132-2/+10
|
* asmc0 -> asmc*mglocker2020-09-121-2/+2
| | | | | | | | Now that asmc(4) attaches through acpi(4), other than with isa(4), acpi(4) could attach multiple SMC chips in theory, even though in practice there will be only one SMC chip per machine. Suggested and ok kettenis@
* Make asmc(4) attach through acpi(4) instead of isa(4).mglocker2020-09-121-2/+2
| | | | | | This e.g. makes the driver also work on iMac11,2. ok kettenis@, jung@
* Include <sys/systm.h> directly instead of relying on hidden UVM includes.mpi2020-09-115-5/+11
| | | | The header is being pulled via db_machdep.h -> uvm_extern.h -> uvm_map.h
* Declare hw_{prod,serial,uuid,vendor,ver} in <sys/systm.h>.visa2020-08-261-5/+1
| | | | OK deraadt@, mpi@
* Use sysctl_bounded_args for simple cases in cpu_sysctl on i386gnezdo2020-08-231-13/+11
| | | | OK kn
* Push KERNEL_LOCK/UNLOCK() dance inside trapsignal().mpi2020-08-192-30/+2
| | | | ok kettenis@, visa@
* base clang is now i586. SMALL_KERNEL images have historically forcedderaadt2020-08-171-2/+2
| | | | | | i486 (for space-saving reasons), but we don't currently need this in bsd.rd so let's try without to see if it improves things in any way (at least until the next have a space-saving crisis)
* additional files from libkern will be needed by clang10deraadt2020-08-023-6/+6
|