summaryrefslogtreecommitdiff
path: root/sys/dev/pv
AgeCommit message (Collapse)Author
2021-06-11Drop received packets unless IFF_RUNNING is set. When hvn(4) attachesPatrick Wildt
it sends commands and waits for replies to come back in. The receive pipe seems to contain both command completions and data packets. When waiting for command completion during hvn(4) attach, it's possible for packets to show up as well. We shouldn't call if_input() if hvn(4) is not set up, so drop them when we're not running. ok mikeb@
2021-05-16panic does not require a \n at the end. When one is provided, it looks wrong.Theo de Raadt
2021-02-23timecounting: use C99-style initialization for all timecounter structscheloha
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@
2021-02-11Initialize var since it's used in a condition a little bit afterwards.Ricardo Mestre
CID 1501713 ok jmatthew@
2021-01-15Report full IP address information to the host. Contrary to what I wroteJonathan Matthew
here 10 years ago, xdr isn't scary at all. ok dlg@
2021-01-13Make vm_rpc_send_rpci_tx_buf() use the buffer passed in, not the bufferJonathan Matthew
allocated as part of the softc, though it's always been the same buffer so far. ok dlg@
2021-01-13put M_ZERO in the right placeJonathan Matthew
ok dlg@
2020-12-12Rename the macro MCLGETI to MCLGETL and removes the dead parameter ifp.jan
OK dlg@, bluhm@ No Opinion mpi@ Not against it claudio@
2020-12-04hvn(4): msleep(9) -> msleep_nsec(9)cheloha
In hvn_alloc_cmd() we may spin waiting for a free rndis_cmd. We check the list once per tick and block with msleep(9) if there aren't any free objects. In practice though we don't need to poll for a free rndis_cmd because our sleep is protected by a mutex, so we can't miss a wakeup(9). That is, it's safe to use msleep_nsec(9) here and not set a timeout (INFSLP). Tested by Andre Stoebe <as@nul.space> (Hyper-V on Windows 10). "LGTM" mikeb@, ok mpi@
2020-12-04hvn(4), hyperv(4): more tsleep(9) -> tsleep_nsec(9) conversionscheloha
Replace all tsleep(..., 1) calls in these drivers with tsleep_nsec(9) calls. In every case we can use the nearby delay(9) intervals as the timeout. Tested by Andre Stoebe <as@nul.space> (Hyper-V on Windows 10). "LGTM" mikeb@, ok mpi@
2020-10-15Ensure resid is correctly set in the INQUIRY case.Kenneth R Westerback
2020-10-15Replace simple one-line bcopy()/memcpy() of faked data into scsi_xfer with callKenneth R Westerback
to scsi_copy_internal_data(). Thus getting xs->resid properly set and adding the usual uio/size sanity checks.
2020-10-15Nuke commented out variable declaration.Kenneth R Westerback
2020-09-22Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'Kenneth R Westerback
member of 'struct scsi_xfer' has always been pointed at the 'struct scsi_generic cmdstore' member of the same instance. So nuke 'cmdstore' and remove the '*' from cmd. Take the address of cmd as required by the various casts. No intentional functional change. luna88k test by aoyama@, sparc64 test by jmatthew@ Identification of 2009's last *cmd use and ok jmatthew@
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-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-04Replace TAILQ concatenation loop with TAILQ_CONCATbket
OK millert@, florian@
2020-09-03Replace '.response_format = 2' with '.response_format = SID_SCSI2_RESPONSE'.Kenneth R Westerback
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-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-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-26Declare hw_{prod,serial,uuid,vendor,ver} in <sys/systm.h>.Visa Hankala
OK deraadt@, mpi@
2020-07-22Nuke unused struct scsi_link members of adapter softc's where theKenneth R Westerback
driver successfully compiles on one or more of amd64, i386, hppa.
2020-07-20Move remaining scsi bus initialization info from "prototype scsi link"Kenneth R Westerback
fields to struct scsibus_attach_args. Nuke the struct scsi_link * (saa_sc_link) in scaibus_attach_args. Explicitly initialize each field in scsibus_attach_args variables.
2020-07-19Move the adapter related items (luns, adapter, adapter_target,Kenneth R Westerback
adapter_buswidth, adapter_softc) from struct scsi_link to struct scsibus_attach_args. Additional compile tests by jmatthew@ (sparc64) and aoyam@ (luna88k).
2020-07-16Access adapter softc via link->bus->sb_adapter_softc.Kenneth R Westerback
In sparc64 autoconf access 'luns' via sb_luns and 'adapter_buswidth' via sb_adapter_buswidth. Removes last post-config uses of the copies of bus related information in scsi_link.
2020-07-11Garbage collect unused vioscsi_softc member "sc_scsibus".Kenneth R Westerback
2020-07-11Expunge some Captain Obvious comments, tweak whitespace a bit, move a debugKenneth R Westerback
statement. All to make upcoming diff(s) smaller and easier to read.
2020-07-10Shuffle a bit of code to stop using sc->sc_link to hold values forKenneth R Westerback
openings outside of the one used at config_found() time. Adapters should take care of their own data. ok dlg@ for a sligthly different vioblk.c version.
2020-07-10Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.Patrick Wildt
ok dlg@ tobhe@
2020-07-06Add support for timeconting in userland.Paul Irofti
This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@
2020-06-29avoid a NULL deref in xen_intr_barrier()Jonathan Gray
intr_barrier() now uses the argument so directly call sched_barrier(NULL) which is what intr_barrier(NULL) used to do until recently. From Todd Carson on bugs@ ok dlg@
2020-06-27Nuke trailing whitespace.Kenneth R Westerback
2020-06-27No need to bzero()/memset() 'struct scsibus_attach_args' variablesKenneth R Westerback
immediately before initializing the only field in the struct.
2020-06-27Replace TAILQ concatenation loop with TAILQ_CONCATbket
As a result remove unneeded variable OK kn@, millert@
2020-06-24kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)cheloha
time_second(9) and time_uptime(9) are widely used in the kernel to quickly get the system UTC or system uptime as a time_t. However, time_t is 64-bit everywhere, so it is not generally safe to use them on 32-bit platforms: you have a split-read problem if your hardware cannot perform atomic 64-bit reads. This patch replaces time_second(9) with gettime(9), a safer successor interface, throughout the kernel. Similarly, time_uptime(9) is replaced with getuptime(9). There is a performance cost on 32-bit platforms in exchange for eliminating the split-read problem: instead of two register reads you now have a lockless read loop to pull the values from the timehands. This is really not *too* bad in the grand scheme of things, but compared to what we were doing before it is several times slower. There is no performance cost on 64-bit (__LP64__) platforms. With input from visa@, dlg@, and tedu@. Several bugs squashed by visa@. ok kettenis@
2020-06-24Use SDEV_NO_ADAPTER_TARGET instead of the value that is beingKenneth R Westerback
aassigned to adapter_buswidth to indicate the adapter is not a target on the bus. ok dlg@ as part of a larger diff.
2020-06-24Use SDEV_NO_ADAPTER_TARGET instead of the value of adapter_buswidth toKenneth R Westerback
indicate the adapter is not a target on the bus. ok dlg@ as part of a larger diff.
2020-06-24Nuke some pointless *_dev_probe() and *_dev_free() functions andKenneth R Westerback
set/trust the scsiconf.c probing limits. Same as was done to vioblk(4). ok dlg@
2020-06-22use ifiq_input and use it's return value to apply backpressure to rxrs.David Gwynne
this is a step toward deprecating softclock based livelock detection.
2020-06-21Nuke pointless vioblk_dev_probe() and vioblk_dev_free() functions andKenneth R Westerback
tweak adapter_target and adapter_buswidth values to provide desired semantic of providing only target 0/lun 0 device per vioblk(4) device. Tested by sf@
2020-05-29dev/rndvar.h no longer has statistical interfaces (removed during variousTheo de Raadt
conversion steps). it only contains kernel prototypes for 4 interfaces, all of which legitimately belong in sys/systm.h, which are already included by all enqueue_randomness() users.
2020-02-16Force a guest info update when we get a Capabilities_Register command.Jonathan Matthew
ESXi doesn't carry the guest info over when a guest gets moved to a different host, and this appears to be the only hint the guest gets that this has happened. ok dlg@
2020-02-14IPS_MAXFER, NAX_XFER, and MAXBSIZE are all definedKenneth R Westerback
as (64 * 1024). Reduce confusion by using MAXPHYS (a.k.a. (64 * 1024)) as other drivers do.
2020-02-13Resolve a few issues with interrupt handlingMike Belopuhov
Upon a failed task_add, the adjusted reference counter needs to be decremented. xen_intr_schedule should follow the same logic as xen_intr. Tested by Niklas Hallqvist. Ok mpi@
2020-02-12Bring a few stragglers into line with the idiom used by the other 40+Kenneth R Westerback
scsi drivers. i.e. eliminate the struct scsi_adapter member in the softc and rely on the pointer to a static scsi_adapter in the struct scsi_link member.
2020-02-05Nuke unnecessary abstraction 'scsi_minphys()' which just callsKenneth R Westerback
'minphys()'. Just use & check for NULL instead, since 'minphys()' is always called on the code path ([cd|sd|st]minphys) that calls physio().
2020-01-26Shuffle some names around to make reading the code less headacheKenneth R Westerback
inducing. Rename scsi_adapter member 'scsi_minphys' to 'dev_minphys' to reflect what it is supposed to do. Use consistent naming convention (<dev>_minphys) for the actual device functions. No functional change.
2020-01-24cleanup unused headers generated by configJonathan Gray
ok tedu@ krw@ deraadt@