summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
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.
2020-08-30Lock all kernel PTE entries into the page tables, even "managed" onesMark Kettenis
entered by pmap_enter(9). Otherwise kernel stack pages get evicted and that doesn't end well. We probably only need to lock in wired pages and I will probably revisit this at some later stage. tested by deraadt@
2020-08-30add missing wakeup for the unlikely dying caseanton
2020-08-30use unique wait messages with msleep_nsec()anton
2020-08-30avoid a invalid pointer deref in hvn_stop()Jonathan Gray
intr_barrier() now uses the argument so directly call sched_barrier(NULL) which is what intr_barrier() used to do until recently. problem reported by and fix tested by Andre Stoebe
2020-08-30PLL1(CPU_PLL) stability improvement for Allwinner H3/H2+SASANO Takayoshi
Due to unstable of PLL1, sometimes the system has hanged up especially at boot. This is observed at Allwinner H3/H2+ processor. To solve the problem, PLL1 setting procedure is same as Linux. 1. change clock source to 24MHz 2. wait 1usec (new) 3. disable PLL1 (new) 4. set new NKMP value, but M should be 1 5. re-enable PLL1 (new) 6. wait PLL1 stable (modified) 7. change clock source to PLL1 8. wait 1usec (new) Once disable PLL1 before setting NKMP is very important. And, sometimes LOCK flag is set even if PLL has not locked yet so wait for PLL is modified with simple delay() by the value of PLL_STABLE_TIME_REG1 register. Not only Allwinner H3/H2+ but also all (i.e. A64) Allwinner processors datasheet has "If the clock source is changed, at most to wait for 8 present running clock cycles." sentence at CPU clock source selection field of CPU/AXI configuration register. But this is ambiguous that _who_ should do _what_ during that cycles. It is unclear that changing clock source itself invoke PLL1 unstability. For safety, added 1usec wait after changing clock source like Linux. ok by kettenis@, thanks to adr at sdf dot org
2020-08-29More recent MMC specificiations add READ(12)/WRITE(12). So add cd_cmd_rw12()Kenneth R Westerback
and let cdstart() use it if the requested i/o is unable to fit into a READ(10). Certainly better than silently truncating the i/o into a READ(10)/WRITE(10).
2020-08-29Use ISSET() to check b_flags for B_READ.Kenneth R Westerback
2020-08-29Missing u_int -> u_int32_t chunks from previous.Kenneth R Westerback
2020-08-29Use u_int32_t for nsecs, making it crystal clear that the valuesKenneth R Westerback
are expected to fit into a 4-byte field.
2020-08-29Only fall back on using the first potential root disk as the boot disk ifMark Kettenis
the boot kernel didn't hand us a valid bootduid. ok visa@
2020-08-29Mark certain sections with debug information as "allocated" such that theyMark Kettenis
get picked up by ddb. This makes the "pp" and "show struct" commands that depends on CTF work. ok gkoehler@
2020-08-29Before clearing the kcov descriptor associated with a thread make sureanton
no other thread is currently within a remote section. Otherwise, the remote subsystem could end up in a broken state where it doesn't reset the necessary bits upon leaving the remote section. Therefore introduce the kr_barrier() routine which waits until all ongoing remote sections have been left. Also, extend the scope of the mutex to also cover fields of struct kcov_dev. This is necessary to ensure correctness. Reported-by: syzbot+64122a5f01be1b1abb96@syzkaller.appspotmail.com
2020-08-29Prepare to extend the scope of the kcov remote mutex by renaming it toanton
something more generic. It will soon cover the whole kcov subsystem.
2020-08-29Have [cd|sd]_cmd_rw[6|10|12|16] return the length of the created command andKenneth R Westerback
have the caller assign it to xs->cmdlen. Pass in xs->cmd instead of xs. A slightly cleaner API that provides the potential of detecting and reacting to a failure to create the desired command.
2020-08-28Shuffle [cd|sd]start code into closer alignment. Move the initialization of theKenneth R Westerback
xs fields to a more convenient location, shrinking upcoming diffs. Nuke some Captain Obvious comments.
2020-08-28Abstract cd_cmd_rw6() and cd_cmd_rw10() a la sd_cmd_rw6() and sd_cmd_rw10().Kenneth R Westerback
2020-08-28Nuke CDF_ANCIENT, SDF_ANCIENT SDEV_ONLYBIG and bogus check of SID_RelAdr inKenneth R Westerback
favour of simply using the device's claimed SCSI level of support. Except of course for ATAPI/USB devices which often don't claim anything. Keep assuming they are at least SCSI-2. Use consistant tests in sdminphys/cdminphys/sdstart/cdstart.
2020-08-28Make fdt root node's model property readable through sysctl hw.productVisa Hankala
2020-08-28Make sure not to pass NULL to explicit_bzero().tobhe
Fixes CID 1496732. ok patrick@
2020-08-28Add missing #if's to fix build without bpf(4).mvs
ok deraadt@
2020-08-28free the correct object when a remote subsystem already is presentanton
2020-08-27Use p2p_rtrequest()kn
Although technically a point-to-multipoint interface, point-to-point semantics apply/fit when installing local routes, e.g. configuring IPv6 addresses on it. This is to fix SIOCGNBRINFO_IN6 and thus ndp(8). Report and diff from Matt Dunwoodie <ncon at noconroy dot net>, thanks! OK tobhe