summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2020-09-08Add a function to scan for PCI Express extended capabilities.Mark Kettenis
From jordan@, with a few more tweaks by myself.
2020-09-08Clean up attachment of octgmx(4) a bitVisa Hankala
2020-09-08Handle AGL interfaceVisa Hankala
This makes certain machines' management network port usable.
2020-09-08If SCSI_IGNORE_ILLEGAL_REQUEST is set no error is returned from scsi_xs_sync()Kenneth R Westerback
when the request is unsupported. So check mode sense(6) and mode sense(10) results for valid headers before passing the results back. Avoid overwriting any error that was returned. ok jmatthew@
2020-09-08Add RK3308 temperature sensors.Jonathan Matthew
ok kettenis@
2020-09-08Add RK3328 PWM, also found in the RK3308.Jonathan Matthew
ok kettenis@
2020-09-07Add a proper VSID allocation scheme for userland segments.Mark Kettenis
2020-09-06Add RK3308 clocksJonathan Matthew
ok kettenis@
2020-09-06amd64: add tsc_delay(), a delay(9) implementation based on the TSCcheloha
In preparation for running the lapic timer in oneshot mode on amd64 we need a replacement for lapic_delay(). Using the lapic timer itself to implement delay(9) when the timer is not running in periodic mode is complicated if not outright impossible. Meanwhile, the i8254 provides our only other amd64 delay(9) implementation and it is an extremely slow clock. On my 2GHz machine, gettick() takes ~20 microseconds to complete *without* mutex contention. On a VM it is even slower, as you must exit the VM for each inb() and outb(). So, add tsc_delay() and use it when we have a constant/invariant TSC. The TSC is a 64-bit "up-counter" so the implementation is simple. Given how slow the i8254 is on modern machines, we may want to add an HPET delay(9) implementation as a fallback for machines where the TSC drifts. The HPET itself is pretty slow, but not as slow as the i8254. Discussed with kettenis@, Mike Larkin, and naddy@. Tweaked by kettenis@. ok kettenis@
2020-09-05Implement spilling of kernel SLB entries. Mostly from FreeBSD.Mark Kettenis
This makes it possible to use more SLB entries for the kernel than the hardware supports. The design is such that a subset of the hardware SLB entries can be replaced when needed. This makes sure the entries mapping kernel code and data and the page tables ar always present. Traps for missing SLB entries are handled in real-mode and on a special stack such that it doesn't have to rely on SLB entires mapping kernel stacks. With this in place we can increase KVA to 32GB. Hopefully that's enough to support large memory configurations.
2020-09-05Whitespace.Mark Kettenis
2020-09-05allow compile of kernels with DDB, in more cases.Theo de Raadt
from Matt Baulch discussed with kettenis and drahn
2020-09-05Rename SID_INQUIRY_HDR (a.k.a. 5) to more explicit SID_SCSI2_HDRLEN and use itKenneth R Westerback
to replace various uses of '5' when calculating the amount of data in the INQUIRY response. Matches up more naturally with SID_SCSI2_ALEN. Also use to fix SCSIDEBUG display of INQUIRY responses to show correct count of bytes received/available.
2020-09-05Add mpii(4).Mark Kettenis
2020-09-05Replace '32' with SID_SCSI2_ALEN (a.k.a. 31) when building emulated INQUIRYKenneth R Westerback
responses. This is what the SCSI specifications say is the correct value and already used in several cases.
2020-09-04Restrict the size of the page table to 2G such that it never occupies moreMark Kettenis
than 8 SLB entries.
2020-09-04Make the kernel address space a bit bigger.Mark Kettenis
2020-09-04Restrict the size of the page table to 2G such that it never occupies moreMark Kettenis
than 8 SLB entries.
2020-09-04Add kstat to cnmac(4)Visa Hankala
This makes various receive and transmit event counters readable. This additionally replaces the old, and somewhat unusual, way of updating error counters in ifp. Most of the hardware counters are 32 bits wide. Hence the code polls them periodically and adds the values to 64-bit software counters. The hardware counters are cleared when read.
2020-09-04Replace TAILQ concatenation loop with TAILQ_CONCATbket
OK millert@, florian@
2020-09-04drm/amdgpu: Fix buffer overflow in INFO ioctlJonathan Gray
From Alex Deucher b5b97cab55eb71daba3283c8b1d2cce456d511a1 in mainline linux
2020-09-04Add RK3308 pinctrl supportJonathan Matthew
ok kettenis@
2020-09-04Add RK3308 GRFJonathan Matthew
ok kettenis@
2020-09-03amd64: lapic: refactor timer programmingcheloha
We reprogram the lapic timer by hand in three separate places. This is error-prone and difficult to read. To clean things up, introduce routines for reprogramming the lapic timer in a given mode. lapic_timer_oneshot() starts a oneshot countdown. lapic_timer_periodic() starts a repeating countdown. Both of these routines call lapic_timer_start(), wherein we actually write the lapic registers. With input from dlg@. Earlier version eyeballed by mlarkin@. Suspend/resume tested by gnezdo@.
2020-09-03Sprinkle some more eieio(); seems to avoid triggering the KASSERT(new > old).Mark Kettenis
2020-09-03The "USL" VT switch and keyboard ioctls are a hack and don't follow theMark Kettenis
proper BSD way where the third argument is always a pointer and data is transferred between userland and kernel using copyin(9) and copyout(9). Intead an int is encoded in the thirs argument. This works on 32-bit architectures and little-endian 64-bit architectures. But not on big-endian 64-bit architectures. Deal with this by handling the argument as long (which matches the size of a pointer). Hopefully we can eliminate these ioctls in the near future. ok deraadt@
2020-09-03Replace '.response_format = 2' with '.response_format = SID_SCSI2_RESPONSE'.Kenneth R Westerback
2020-09-02Add #define SID_SCSI2_RESPONSE 0x2 to allow elimination of another bunch ofKenneth R Westerback
magic numbers. As the nearby comment says '< 2 is obsolete. >2 is reserved'. So 0x2 is just right.
2020-09-02When building emulated INQUIRY results use the SCSI_REV_* #define's toKenneth R Westerback
initialize the 'version' field. Not numbers.
2020-09-02When building emulated INQUIRY results use the SCSI_REV_* #define's toKenneth R Westerback
initialize the 'version' field. Not numbers.
2020-09-02vfs_shutdown() is neccessary to ensure buffer cache drain before reexec()Theo de Raadt
ok kettenis visa
2020-09-02Don't rely on wTotalLength for usbd_get_cdesc() malloc/free but on theMarcus Glocker
actual length which has been allocated. We saw cases where the wTotalLength value is changing on a second read, e.g. when a USB device was waked up from sleep mode. ok mpi@
2020-09-01Fix signotify() for powerpc64 bsd.mpgkoehler
Copy signotify() from amd64, so that if proc *p is on another cpu, then signotify(p) notifies the correct cpu. ok kettenis@
2020-09-01zap nasty whitespaceTheo Buehler
2020-09-01Implement address translation for bus_space_mmap(9).Mark Kettenis
2020-09-01Store the device tree node in the pcitag_t.Mark Kettenis
2020-09-01Fix a leak due to a missing free on m_defrag(m, M_NOWAIT) failure.Theo Buehler
Reported by Maxime Villard, fix from Matt Dunwoodie after feeedback from claudio who is fine with either of the two suggested fixes going in.
2020-09-01Add PMAP_NOCACHE flag to the address returned by the genericMark Kettenis
bus_space_mmap(9) implementation to make sure we enter mappings with the right memory attributes.
2020-09-01Fix write un-protecting of kernel memory. p was used uninitializedPatrick Wildt
at the beginning of the loop. We need to use cr3 at the start of each iteration for the top level page directory. From and ok sf@
2020-09-01Rename [READ|WRITE]_BIG to [READ|WRITE]_10. Rename struct scsi_rw_big toKenneth R Westerback
struct scsi_rw_10. ok gnezdo@ jmatthew@ (who also did sparc64 compile test)
2020-09-01Use sysctl_bounded_args for simple cases in cpu_sysctl on loongsongnezdo
deraadt@: looks fine
2020-09-01Remove unused sysctl_int_arr(9)gnezdo
2020-09-01Convert *_sysctl in ipsec_input.c to sysctl_bounded_arrgnezdo
The best-guessed limits will be tested by trial.
2020-09-01Convert icmp6_sysct to sysctl_bounded_argsgnezdo
The best-guessed limits will be tested by trial.
2020-08-31crank to 6.8-betaTheo de Raadt
2020-08-31Backout clear endpoint stall on open(2). It seems to break an illuminatedPatrick Wildt
Logitech keyboard for unknown reasons. Reported by denis@ ok djm@
2020-08-30Don't include "net/netisr.h" header. It's not needed here.mvs
ok yasuoka@
2020-08-30pppac(4) uses per cpu counters for collect `ifnet' statistics, but inmvs
pipex(4) layer this `ifnet' still uses `if_data'. Also pppx(4) doesn't use per cpu counters but `if_data'. Add per cpu counters to pppx(4) and pipex(4). This finishes interface statistics collecting mess. ok yasuoka@
2020-08-30Compactify SDEV_/ADEV_ flags & quirks to eliminate the gaps in bit use and thusKenneth R Westerback
allow shrinking the names arrays.
2020-08-30Reorganize the interrupt handler code to avoid a potential bogus KASSERT,Mark Kettenis
handle the priority levels better and guarantee ordering of restoring the priority level after running an interrupt handler and checking for a new interrupt.