summaryrefslogtreecommitdiffstats
path: root/sys/dev/pv
AgeCommit message (Collapse)AuthorFilesLines
2021-02-23timecounting: use C99-style initialization for all timecounter structscheloha2-3/+17
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.mestre1-2/+2
CID 1501713 ok jmatthew@
2021-01-15Report full IP address information to the host. Contrary to what I wrotejmatthew1-9/+300
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 bufferjmatthew1-2/+2
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 placejmatthew1-2/+2
ok dlg@
2020-12-12Rename the macro MCLGETI to MCLGETL and removes the dead parameter ifp.jan3-5/+5
OK dlg@, bluhm@ No Opinion mpi@ Not against it claudio@
2020-12-04hvn(4): msleep(9) -> msleep_nsec(9)cheloha1-2/+2
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) conversionscheloha2-12/+24
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.krw1-0/+1
2020-10-15Replace simple one-line bcopy()/memcpy() of faked data into scsi_xfer with callkrw2-4/+5
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.krw1-2/+1
2020-09-22Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'krw4-23/+23
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 itkrw1-2/+3
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 INQUIRYkrw2-4/+4
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_CONCATbket1-5/+2
OK millert@, florian@
2020-09-03Replace '.response_format = 2' with '.response_format = SID_SCSI2_RESPONSE'.krw3-5/+5
2020-09-02When building emulated INQUIRY results use the SCSI_REV_* #define's tokrw1-2/+2
initialize the 'version' field. Not numbers.
2020-09-02When building emulated INQUIRY results use the SCSI_REV_* #define's tokrw1-2/+2
initialize the 'version' field. Not numbers.
2020-09-01Rename [READ|WRITE]_BIG to [READ|WRITE]_10. Rename struct scsi_rw_big tokrw2-16/+16
struct scsi_rw_10. ok gnezdo@ jmatthew@ (who also did sparc64 compile test)
2020-08-30avoid a invalid pointer deref in hvn_stop()jsg1-1/+1
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>.visa1-2/+1
OK deraadt@, mpi@
2020-07-22Nuke unused struct scsi_link members of adapter softc's where thekrw4-7/+3
driver successfully compiles on one or more of amd64, i386, hppa.
2020-07-20Move remaining scsi bus initialization info from "prototype scsi link"krw4-21/+23
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,krw4-22/+23
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.krw4-19/+19
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".krw1-3/+2
2020-07-11Expunge some Captain Obvious comments, tweak whitespace a bit, move a debugkrw3-6/+7
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 forkrw2-9/+11
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.patrick3-6/+6
ok dlg@ tobhe@
2020-07-06Add support for timeconting in userland.pirofti2-3/+3
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()jsg1-7/+3
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.krw1-2/+2
2020-06-27No need to bzero()/memset() 'struct scsibus_attach_args' variableskrw4-7/+3
immediately before initializing the only field in the struct.
2020-06-27Replace TAILQ concatenation loop with TAILQ_CONCATbket1-7/+2
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)cheloha2-4/+4
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 beingkrw2-3/+3
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 tokrw2-4/+4
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 andkrw1-14/+5
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.dlg1-2/+4
this is a step toward deprecating softclock based livelock detection.
2020-06-21Nuke pointless vioblk_dev_probe() and vioblk_dev_free() functions andkrw1-21/+5
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 variousderaadt7-16/+5
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.jmatthew1-3/+11
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 definedkrw2-12/+10
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 handlingmikeb1-2/+4
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+krw3-20/+16
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 callskrw4-7/+7
'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 headachekrw3-5/+5
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 configjsg2-5/+3
ok tedu@ krw@ deraadt@
2020-01-23Use a consistant idiom/format when declaring scsi_adapter structureskrw1-3/+2
in drivers. Terse one liners, NULLs instead of 0's, explicitly specify all members, etc. Nuke #ifdef notyet blocks related to the scsi_adapter in aic. No intentional functional change. ok tedu@
2020-01-22xbf(4): tsleep(9) -> tsleep_nsec(9); ok mikeb@cheloha1-2/+2