summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
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
2020-08-27Fix a potential panic during free(9) which can be caused by an USBMarcus Glocker
device which returns a spurious value for wTotalLength on a configuration descriptor request. Therefore don't relay on wTotalLength for free(9) but on the length variable which was used for the malloc(9) before. The issue was reported by Mikolaj Kucharski <mikolaj (at) kucharski (dot) name> on bugs@. Discussed and ok deraadt@
2020-08-27usbd_get_cdesc() returns usb_config_descriptor_t *. Therefore returnMarcus Glocker
'NULL' instead of '0'. ok deraadt@
2020-08-27Clear endpoint stall on open(2) of /dev/uhidX to synchronize toggle bitPatrick Wildt
as needed on xhci(4) machines. On non-xhci(4) we save and restore the toggle bit on close/open of a pipe. With xhci(4) this does not seem to be possible, at least I haven't yet found it. This means that on those machines with xhci(4), after a pipe close/open, the device will use the previous state, while xhci(4)'s state is reset to default. By issuing a clear endpoint stall we reset the device's toggle bit. Now every time a /dev/uhid is (re-)opened the state should be synchronized. Discussed with damien@, mpi@ and Pedro Marteletto ok markus@
2020-08-27Improve write un-protecting of kernel memory. For the Computrace modulePatrick Wildt
on the HP EliteBook 830 G6 we added a workaround which tries to re-map the pages where we want to place to kernel read-write. On some machines though this workaround causes a regression. Fix those by changing a few things: Only set the writeable bit if it isn't set yet. Un-protect write-protected page directories. Skip lower levels if large-page is set, since the next level is already a page. Don't do anything at all if paging is disabled. From Christian Ehrhardt ok bluhm@ tobhe@