IABSD.fr/src/sys/dev/pv

Branch :


Log

Author Commit Date CI Message
4b1a56af 2022-01-09 05:42:36 spelling feedback and ok tb@ jmc@ ok ratchov@
ffaee248 2021-11-05 11:38:29 Constify struct cfattach.
04c68813 2021-10-24 09:16:53 pretty & normalize the cfdriver decl
69b036cd 2021-08-31 15:52:10 When running on Hyper-V, make use of its timecounter as delay func in case we're still using the i8254 for that. On Hyper-V Gen 2 VMs there is no i8254 we can trust, so we need some kind of fallback, especially if there is no TSC either. Discussed with the hackroom ok kettenis@
4a58382d 2021-07-26 11:06:36 fix an mbuf leak with m_len 0 mbufs from niklas@ via mikeb@
1ab70bb7 2021-07-26 06:00:37 Add mtx_enter/mtx_leave in kvp_pool_keys(). ok mikeb
e977d71d 2021-06-11 12:47:15 Drop received packets unless IFF_RUNNING is set. When hvn(4) attaches 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@
4123b6a7 2021-05-16 15:10:19 panic does not require a \n at the end. When one is provided, it looks wrong.
8611d3cd 2021-02-23 04:44:30 timecounting: use C99-style initialization for all timecounter structs 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@
2f79a14d 2021-02-11 11:57:32 Initialize var since it's used in a condition a little bit afterwards. CID 1501713 ok jmatthew@
319c37cd 2021-01-15 06:14:41 Report full IP address information to the host. Contrary to what I wrote here 10 years ago, xdr isn't scary at all. ok dlg@
73a8717b 2021-01-13 23:56:48 Make vm_rpc_send_rpci_tx_buf() use the buffer passed in, not the buffer allocated as part of the softc, though it's always been the same buffer so far. ok dlg@
b02e1729 2021-01-13 23:50:21 put M_ZERO in the right place ok dlg@
471f2571 2020-12-12 11:48:52 Rename the macro MCLGETI to MCLGETL and removes the dead parameter ifp. OK dlg@, bluhm@ No Opinion mpi@ Not against it claudio@
b6a411b5 2020-12-04 18:05:26 hvn(4): msleep(9) -> msleep_nsec(9) 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@
b910befe 2020-12-04 03:22:46 hvn(4), hyperv(4): more tsleep(9) -> tsleep_nsec(9) conversions 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@
3f3b0cb2 2020-10-15 17:47:24 Ensure resid is correctly set in the INQUIRY case.
a83ec286 2020-10-15 13:22:12 Replace simple one-line bcopy()/memcpy() of faked data into scsi_xfer with call to scsi_copy_internal_data(). Thus getting xs->resid properly set and adding the usual uio/size sanity checks.
176be72c 2020-10-15 11:30:08 Nuke commented out variable declaration.
664c6166 2020-09-22 19:32:51 Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd' 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@
65e0582e 2020-09-05 14:21:52 Rename SID_INQUIRY_HDR (a.k.a. 5) to more explicit SID_SCSI2_HDRLEN and use it 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.
3ca8dabf 2020-09-05 13:05:06 Replace '32' with SID_SCSI2_ALEN (a.k.a. 31) when building emulated INQUIRY responses. This is what the SCSI specifications say is the correct value and already used in several cases.
9e34d16a 2020-09-04 13:10:16 Replace TAILQ concatenation loop with TAILQ_CONCAT OK millert@, florian@
bb4b71eb 2020-09-03 12:41:28 Replace '.response_format = 2' with '.response_format = SID_SCSI2_RESPONSE'.
25a9dbe6 2020-09-02 22:00:26 When building emulated INQUIRY results use the SCSI_REV_* #define's to initialize the 'version' field. Not numbers.
b291b595 2020-09-02 21:16:29 When building emulated INQUIRY results use the SCSI_REV_* #define's to initialize the 'version' field. Not numbers.
eccd596d 2020-09-01 12:17:52 Rename [READ|WRITE]_BIG to [READ|WRITE]_10. Rename struct scsi_rw_big to struct scsi_rw_10. ok gnezdo@ jmatthew@ (who also did sparc64 compile test)
594bc22f 2020-08-30 10:36:33 avoid a invalid pointer deref in hvn_stop() 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
85fcfc35 2020-08-26 03:29:05 Declare hw_{prod,serial,uuid,vendor,ver} in <sys/systm.h>. OK deraadt@, mpi@
7380a3a4 2020-07-22 13:16:04 Nuke unused struct scsi_link members of adapter softc's where the driver successfully compiles on one or more of amd64, i386, hppa.
e5eae15d 2020-07-20 14:41:12 Move remaining scsi bus initialization info from "prototype scsi link" 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.
ead808c4 2020-07-19 18:57:57 Move the adapter related items (luns, adapter, adapter_target, adapter_buswidth, adapter_softc) from struct scsi_link to struct scsibus_attach_args. Additional compile tests by jmatthew@ (sparc64) and aoyam@ (luna88k).
0b29cb40 2020-07-16 21:18:29 Access adapter softc via link->bus->sb_adapter_softc. 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.
a0d66453 2020-07-11 20:15:52 Garbage collect unused vioscsi_softc member "sc_scsibus".
e803e20a 2020-07-11 13:34:05 Expunge some Captain Obvious comments, tweak whitespace a bit, move a debug statement. All to make upcoming diff(s) smaller and easier to read.
c0d956de 2020-07-10 19:43:09 Shuffle a bit of code to stop using sc->sc_link to hold values for 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.
0cae21bd 2020-07-10 13:26:36 Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API. ok dlg@ tobhe@
d82e6535 2020-07-06 13:33:05 Add support for timeconting in userland. 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@
3eec3140 2020-06-29 06:50:52 avoid a NULL deref in xen_intr_barrier() 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@
382c0517 2020-06-27 17:28:58 Nuke trailing whitespace.
a7997e14 2020-06-27 14:29:44 No need to bzero()/memset() 'struct scsibus_attach_args' variables immediately before initializing the only field in the struct.
040fedc0 2020-06-27 07:20:57 Replace TAILQ concatenation loop with TAILQ_CONCAT As a result remove unneeded variable OK kn@, millert@
3209772d 2020-06-24 22:03:40 kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9) 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@
182e13b7 2020-06-24 18:59:30 Use SDEV_NO_ADAPTER_TARGET instead of the value that is being aassigned to adapter_buswidth to indicate the adapter is not a target on the bus. ok dlg@ as part of a larger diff.
9667f96c 2020-06-24 18:47:56 Use SDEV_NO_ADAPTER_TARGET instead of the value of adapter_buswidth to indicate the adapter is not a target on the bus. ok dlg@ as part of a larger diff.
3c596f75 2020-06-24 01:35:29 Nuke some pointless *_dev_probe() and *_dev_free() functions and set/trust the scsiconf.c probing limits. Same as was done to vioblk(4). ok dlg@
447a2df6 2020-06-22 02:31:32 use ifiq_input and use it's return value to apply backpressure to rxrs. this is a step toward deprecating softclock based livelock detection.
16ac8c7f 2020-06-21 16:46:34 Nuke pointless vioblk_dev_probe() and vioblk_dev_free() functions and 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@
c8f27247 2020-05-29 04:42:23 dev/rndvar.h no longer has statistical interfaces (removed during various 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.
421bfb1f 2020-02-16 03:23:05 Force a guest info update when we get a Capabilities_Register command. 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@
c8d4e68a 2020-02-14 15:56:47 IPS_MAXFER, NAX_XFER, and MAXBSIZE are all defined as (64 * 1024). Reduce confusion by using MAXPHYS (a.k.a. (64 * 1024)) as other drivers do.
78588113 2020-02-13 15:39:02 Resolve a few issues with interrupt handling 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@
4d7d9900 2020-02-12 14:08:56 Bring a few stragglers into line with the idiom used by the other 40+ 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.
21ceeee0 2020-02-05 16:29:29 Nuke unnecessary abstraction 'scsi_minphys()' which just calls 'minphys()'. Just use & check for NULL instead, since 'minphys()' is always called on the code path ([cd|sd|st]minphys) that calls physio().
9f36bc94 2020-01-26 00:53:31 Shuffle some names around to make reading the code less headache 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.
854a1b2d 2020-01-24 05:14:51 cleanup unused headers generated by config ok tedu@ krw@ deraadt@
a867c811 2020-01-23 07:52:59 Use a consistant idiom/format when declaring scsi_adapter structures 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@
c19253d5 2020-01-22 02:02:31 xbf(4): tsleep(9) -> tsleep_nsec(9); ok mikeb@
11cf39dc 2020-01-11 21:30:00 xenstore: *sleep(9) -> *sleep_nsec(9); ok mikeb@
03604742 2019-12-31 10:05:32 Convert infinite sleeps to {m,t}sleep_nsec(9). ok kn@
44bcf650 2019-12-31 01:26:56 include sys/sensors.h for sensor use
aa3e15ec 2019-12-19 10:15:21 Add size for free() in vio(4). There is an existing allocsize variable tracking size of allocations, turns out we can pass it to free in the error path. OK florian@, mpi@
274ac25b 2019-12-13 06:43:46 pvclock(4): attach even if when PVCLOCK_FLAG_TSC_STABLE is unset Attaches pvclock with lower priority (500) in case of unstable tsc (PVCLOCK_FLAG_TSC_STABLE) instead of not attaching at all. In this state, we do make sure to return a monotonically increasing number. This mostly helps openbsd guests on openbsd vmm(4) where a pvclock with unstable tsc is still better than i8254. ok mlarkin@
0296da5a 2019-12-13 02:16:53 Always release interrupt source when unmasking the interrupt xen_intr_unmask_release was not decrementing the reference counter on the interrupt source structure when bailing out early which led to the refcnt overflow. From niklas, ok mlarkin
cc77704b 2019-10-25 07:13:54 Remove some space before tab and other small indentation errors.
3b758f9b 2019-10-07 15:36:01 Attach Hyper-V guest services to VMBus 4.0 Tested by Andre Stoebe and Remi Locherer. ok deraadt, tb
7b732f28 2019-09-01 15:03:32 Adopt the SCSI versioning #define's from FreeBSD. Eliminate the now unneeded version_to_spc() mapping array, a duplicate #define and a couple of magic numbers. Toss in some comments for future generations of spelunkers. Makes it possible to check for specific SPC versions when new features or eliminated features require such a check. No intentional functional change.
0b90b277 2019-08-30 17:41:18 Don't use misleadingly named SCSISPC() which returns SCSI version not SPC version. Use raw data in version field to check the SPC level until SCSISPC() is straightened out. Actually a bit clearer to read as the raw data is what is manipulated in adjacent code.
35937439 2019-08-06 19:24:45 The vio(4) interface did not recover from mbuf shortage. The logic to start the rx tick did not work since we use if_rxr_get(). An easy fix is to start the rx timeout every second unconditionally. OK dlg@
d8499287 2019-05-26 15:22:30 Support virtio 1.0 for virtio_pci virtio 1.0 for virtio_mmio it not yet implemented, but 0.9 devices continue to work.
0091658a 2019-05-26 15:20:04 Rework virtio_negotiate_features() Add a sc_driver_features field that is automatically used by virtio_negotiate_features() and during reinit. Make virtio_negotiate_features() return an error code. Virtio 1.0 has a special status bit for feature negotiation that means that negotiation can fail. Make virtio_negotiate_features() return an error code instead of the features. Make virtio_reinit_start() automatically call virtio_negotiate_features(). Add a convenience function virtio_has_feature() to make checking bits easier. Add an error check in viomb for virtio_negotiate_features because it has some feature bits that may cause negotiation to fail. More error checking in the child drivers is still missing. ok mlarkin@
b5ec98cc 2019-05-13 15:40:34 vmm: add host side pvclock Emulate kvm pvclock in vmm(4). Compatible with pvclock(4) in OpenBSD. Linux does not attach to this (yet). Fixes by reyk@ and tested extensively by reyk@, tb@ and phessler@ ok mlarkin@ phessler@ reyk@
42004ccb 2019-04-17 21:44:32 Remove unused parameter from virtio_init_vq()
4cb18956 2019-04-17 21:43:46 Initialize virtqueue before passing it to device Reported by Gary Zibrat
b3dbd5f2 2019-03-24 18:22:36 virtio: Add a few feature bit defines and names ok mlarkin@
750a9ae1 2019-03-24 18:21:12 virtio: Prepare for 64 feature bits virtio 1.0 supports an arbitrary number of feature bits. However, so far no more than 64 are used (compared to 32 in virtio 0.9). Adjust data types to support 64 feature bits. Later, we may want to use bitmaps and setbit(), ... to support even more feature bits. ok mlarkin@
ee262b2e 2019-03-24 18:17:24 virtio: adjust virtio_setup_queue prototype for 1.0 Make it take an address instead of a PFN. Pass the virtqueue pointer. In virtio 1.0, more information has to be configured in the device. Also call virtio_setup_queue() after the information has been filled in. ok mlarkin@
203af93c 2019-01-19 16:23:46 virtio: Introduce defines for config(8) flags
090e143c 2019-01-19 16:21:00 viomb: tweak feature negotiation VIRTIO_F_RING_INDIRECT_DESC is always negotiated by the transport driver, no need to specify it explicitly. VIRTIO_BALLOON_F_MUST_TELL_HOST is not offered but is handled in the code. Offer it during negotiation, too.
5acd3de4 2019-01-10 18:22:17 Fix previous It accidentally contained a part of a different diff.
fbc65ea9 2019-01-10 18:11:42 Move some PCI-specific defines to a new virtio_pcireg.h file Also add some virtio 1.0 status and feature bits
e578ff6a 2019-01-10 18:06:56 Remove some more code if VIRTIO_DEBUG is 0
1dd6effc 2019-01-10 18:05:43 Move some common defines to virtiovar.h And fix some comments
6164d80c 2019-01-08 16:24:09 viocon: Remove obsolete handling of sc_intrhand
c30b7943 2019-01-08 16:23:01 virtio: Don't include feature strings without VIRTIO_DEBUG They are only used if VIRTIO_DEBUG is enabled. This should make the kernel slightly smaller.
c14cae50 2018-12-05 18:02:51 Correctly disable pvclock(4) on old hardware that lack a stable clock I falsely assumed that the KVM_FEATURE_CLOCKSOURCE_STABLE_BIT indicates that the actual clock values are stable, but it turned out that this isn't always the case. To detect if the clock value is stable, we now read it once in pvclock_attach() and check for the PVCLOCK_FLAG_TSC_STABLE flag. This needs further investigation. Reported and fix tested by johnw.mail at gmail.com OK chris@ phessler@
c9ec5b84 2018-11-24 13:12:29 only attach pvclock(4) inside a KVM guest tested by brynet@ OK reyk@
22d921f9 2018-11-23 12:37:40 Add the pvclock(4) guest driver for paravirtual clocks This improves timekeeping on KVM guests as it runs much better than the virtualized acpihpet or acpitimer timecounters and the invtsc is not always available. Many thanks to Janne Johansson, landry@, and benno@ for testing amd64/i386. OK mlarkin@ phessler@
126b881f 2018-09-25 13:46:44 Insert a workaround for per-ifp ioctl being called w/o NET_LOCK(). An example of such code path is vlan_destroy() where we don't want to grab the lock because this driver is already NET_LOCK()-free. The real solution to this problem is to stop holding the NET_LOCK() around driver *_ioctl() routines. Problem reported & fix tested by Élie Bouttier, ok visa@, bluhm@
5f7616cc 2018-08-24 16:07:01 Add common Ethernet interface attributes to vio(4)'s build config. OK deraadt@
dbe7e165 2018-05-17 12:32:33 Let hvn_iff handle promisc mode activation Tested by Daniel Wade, <Daniel2 ! Wade at ge ! com>, thanks!
9e9abf5b 2018-04-28 15:44:59 replace add_*_randomness with enqueue_randomness() this gets rid of the source annotation which doesn't really add anything other than adding complexitiy. randomess is generally good enough that the few extra bits that the source type would add are not worth it. ok mikeb@ deraadt@
769cb144 2018-03-11 14:31:34 Workaround an Azure UDP transmit checksum offloading bug According to https://reviews.freebsd.org/D12429, UDP transmit checksum offloading doesn't work in Azure when sizeof(IP hdr + UDP hdr + payload) is greater than 1420 and don't fragment bit isn't set in the IP header. Instead of peeking into the packet and attempting to fix the fallout, we restrict UDP checksum offloading to NDIS versions newer than the one used in Azure (6.30) in an attempt to keep the feature enabled. Unfortunately, there's no way to tell Azure apart from a standalone Hyper-V to make this check more precise.
c72a87aa 2018-03-08 05:33:56 Implement the VMWare vmbackup protocol using vfs_stall(). This lets you clone running guests and take disk-only snapshots, most of the time ending up with a clean filesystem. ok dlg@ deraadt@
f0b002d0 2018-02-27 08:44:58 Release the netlock when sleeping for control messages in in vioioctl(). Prevents a deadlock reported by aalm@
3e676399 2018-02-19 08:59:52 Remove almost unused `flags' argument of suser(). The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
220dd317 2018-01-21 18:54:46 Release interrupt source if the interrupt task is already scheduled Tested by Imre Oolberg, thanks!
b5e9546a 2018-01-21 18:51:19 Improve panic message
b47fcd48 2018-01-20 20:03:45 Disable TCP and UDP transmit checksum offloading In certain configurations, transmit checksum offloading doesn't appear to work correctly, preventing correct TCP and UDP operation. Some of these issues involving VLAN tagging are documented by the Xen project. Problem reported and fix tested by Imre Oolberg, thanks!
15c2e150 2018-01-18 11:43:20 Fix an off-by-one uncovered by the recent free(9) change From canacar@, thanks!