aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/hyperv
Commit message (Collapse)AuthorAgeFilesLines
* sys/kbio.h: make pre-unicode keymap support optionalStefan Eßer2023-02-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | FreeBSD-9 had introduced support for the full set of Unicode characters to the parsing and processing of keymap character tables. This support has been extended to cover the table for accented characters that are reached via dead key combinations in FreeBSD-13.2. New ioctls have been introduced to support both the pre-Unicode and the Unicode formats and keyboard drivers have been extended to support those ioctls. This commit makes the ABI compatibility functions in the kernel optional and dependent on COMPAT_FREEBSD13 in -CURRENT. The kbdcontrol command in -CURRENT and 13-STABLE (before 13.2) has been made ABI compatible with old kernels to allow a new world to be run on an old kernel (that does not have full Unicode support for keymaps). This commit is not to merged back to 12-STABLE or 13-STABLE. It is part of review D38465, which has been split into 3 separate commits due to different MFC and life-time requirements of either commit. Approved by: imp Differential Revision: https://reviews.freebsd.org/D38465
* Support Unicode characters in keymap dead key tablesStefan Eßer2023-02-061-0/+1
| | | | | | | | | | | | | | | | | | | Support for Unicode characters had been added to the keyboard code, but there are keymaps that have accented characters accessed via dead key combinations, and those were still restricted to 8 bit codes. This update to kbd.c adds support for Unicode characters and compatibility code that allows a kbdcontrol command built from kbio.h without these patches to work on a new kernel. Compatibility code that allows a new kbdcontrol binary running on an old kernel to load and display the dead key map will be committed in a separate commit. Reviewed by: imp, brooks Approved by: brooks MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38381
* hv_hid: Hyper-V HID driverYuri2023-02-051-0/+564
| | | | | | | | | Hyper-V HID driver using hidbus/hms. Reviewed by: wulf MFC after: 1 week PR: 221074 Differential revision: https://reviews.freebsd.org/D38140
* hyperv: purge EOL release compatibilityElliott Mitchell2023-02-044-206/+0
| | | | | | | | Remove FreeBSD 11 and earlier support Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/603 Differential Revision: https://reviews.freebsd.org/D35560
* arm64: Hyper-V: vPCI: Fix typo and some indentationsWei Hu2023-02-011-22/+21
| | | | | | | | | Fix a typo and some indentation errors in the previous commits. Reported by: jrtc27 Fixes: db247798c5640 ("arm64: Hyper-V: vPCI: SPI MSI mapping for gic v3 acpi in arm64") Fixes: 6e5b082cab8d9 ("arm64: Hyper-V: vPCI: Adding Hyper-V PCI protocol 1.4") Sponsored by: Microsoft
* arm64: Hyper-V: vPCI: Enabling v-PCI in FreeBSD in ARM64 Hyper-VWei Hu2023-02-011-57/+214
| | | | | | | | | | | | | | | | This patch does remaining enablement in hyperv vpci driver to work on arm64 Hyper-V. For that it required to use PCI protocol 1.4 and corresponding different PCI message handling. Also new MSI allocation, MSI-X mapping, release. This is the last patch of total three patches to enalbe Hyper-V vPCI support in arm64. Reviewed by: whu Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Obtained from: Souradeep Chakrabarti <schakrabarti@microsoft.com> Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D37958
* arm64: Hyper-V: vPCI: Adding Hyper-V PCI protocol 1.4Wei Hu2023-02-011-3/+80
| | | | | | | | | | | | | | This is enabling the PCI protocol 1.4 and corresponding structures in order to support arm64 Hyper-V. This is the 2nd of the three patches to enable Hyper-V vPCI support in arm64. Reviewed by: whu Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Obtained from: Souradeep Chakrabarti <schakrabarti@microsoft.com> Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D37780
* evdev: Extend EVIOCGRAB ioctl scope to cover kbd interfaceVladimir Kondratyev2022-11-181-0/+2
| | | | | | | | | | | | | | of various keyboard drivers. EVIOCGRAB ioctl execution on /dev/input/event# device node gains exclusive access to this device to caller. It is used mostly for development purposes and remote control software. See e.g. https://reviews.freebsd.org/D30020 which is the reason of creation of this change. Keyboard grabbing is disabled in KDB and during panics. MFC with: 4a0db5e2920c Tested by: corvink Differential revision: https://reviews.freebsd.org/D30542
* arm64: Hyper-V: making INTR MP SafeSouradeep Chakrabarti2022-11-041-1/+1
| | | | | | | | Makeing the interrupt MP safe. Reviewed by: andrew Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D37222
* arm64: Hyper-V: fixing hung issue during Hyper-V initializationSouradeep Chakrabarti2022-11-011-1/+41
| | | | | | | | | | | In non-Hyper-V systems during Hyper-V initialization, system initialization was getting hung, as hyperv_identify(), was returning successful irrespective of the type of the platform. Reviewed by: andrew, whu Fixes: 9729f076e4d Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D37219
* arm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 3, final)Souradeep Chakrabarti2022-10-2711-546/+120
| | | | | | | | | | | | This is the last part for ARM64 Hyper-V enablement. This includes commone files and make file changes to enable the ARM64 FreeBSD guest on Hyper-V. With this patch, it should be able to build the ARM64 image and install it on Hyper-V. Reviewed by: emaste, andrew, whu Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D36744
* Hyper-V: Code refactor to avoid redundancy of MSR values on x86 and arm64Souradeep Chakrabarti2022-10-268-291/+185
| | | | | | | | | Refactor the code to put split the MSR values for x86 and arm64 Hyper-V. Code not yet built. This is one of several patches for the arm64 Hyper-V enablement. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D37103
* arm64: Hyper-V: fix couple more commit errors caused by duplicated linesWei Hu2022-10-242-288/+0
| | | | | | | | Remove those duplicated lines. Reported by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Fixes: 6cf00ef80c20148 Sponsored by: Microsoft
* arm64: Hyper-V: fix a commit error caused duplicated lines in vmbus_aarch64.cWei Hu2022-10-211-157/+0
| | | | | | | | Remove those duplicated lines. Reported by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Fixes: 6cf00ef80c20148 Sponsored by: Microsoft
* arm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 2)Souradeep Chakrabarti2022-10-214-0/+670
| | | | | | | | | | | This is the second part of the ARM64 Hyper-V enablement. These changes here are mostly with Make, release changes and also changes required in vmbus.c hyperv.c and common files in hyperv. Reviewed by: whu Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D36467
* arm64: Hyper-V: vmbus: use the IRQ resource from vmbus_resSouradeep Chakrabarti2022-10-211-1/+3
| | | | | | | | | | In ARM64 gen2 Hyper-V, use IRQ resource from vmbus_res, which is owning the IRQ for current device tree. It allows the MMIO resource to be successfully allocated for vmbus from parent acpi_syscontainer. Reviewed by: whu Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D37064
* arm64: enablement for ARM64 in Hyper-V (Part 1)Souradeep Chakrabarti2022-09-295-0/+1052
| | | | | | | | | | | | | The changes are to refactor the code of vmbus.c and hyperv.c to keep minimal arch specific codes there and have them in separate files in x86/ arm64/ . x86 is a new directory, which contains codes for x86 / x86_64. Instead of repeating the same codes in existing amd64/ and i386/, this approach reduced the repetition. This is first of three patches for Hyper-V enablement. Reviewed by: whu Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D36466
* kmem_malloc/free: Use void * instead of vm_offset_t for kernel pointers.John Baldwin2022-09-221-3/+2
| | | | | | Reviewed by: kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36549
* Hyper-V: storvsc: relax a couple more kassertsWei Hu2022-09-081-4/+3
| | | | | | | Seems these kasserts don't work well on ARM64 Fixes: 0af5a0cd2788e Sponsored by: Microsoft
* Hyper-V: storvsc: relax a kassert checkWei Hu2022-09-071-1/+4
| | | | | | On ARM64 this kassert check could cause unnecessary panic. Sponsored by: Microsoft
* hyperv: Fix a typo in a source code commentGordon Bergling2022-09-041-1/+1
| | | | | | - s/Unsupport/Unsupported/ MFC after: 3 days
* hyperv: Remove a double word in a source code commentGordon Bergling2022-09-041-1/+1
| | | | | | - s/the the/the/ MFC after: 3 days
* protosw: refactor protosw and domain static declaration and loadGleb Smirnoff2022-08-171-30/+17
| | | | | | | | | | | | | | | | | | | o Assert that every protosw has pr_attach. Now this structure is only for socket protocols declarations and nothing else. o Merge struct pr_usrreqs into struct protosw. This was suggested in 1996 by wollman@ (see 7b187005d18ef), and later reiterated in 2006 by rwatson@ (see 6fbb9cf860dcd). o Make struct domain hold a variable sized array of protosw pointers. For most protocols these pointers are initialized statically. Those domains that may have loadable protocols have spacers. IPv4 and IPv6 have 8 spacers each (andre@ dff3237ee54ea). o For inetsw and inet6sw leave a comment noting that many protosw entries very likely are dead code. o Refactor pf_proto_[un]register() into protosw_[un]register(). o Isolate pr_*_notsupp() methods into uipc_domain.c Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D36232
* Hyper-V: storvsc: Call bus_dmamap_sync() for dma operationsWei Hu2022-08-151-0/+25
| | | | | | | | | Call bus_dmamap_sync() for related dma operations. This is required on ARM64 architecture. Tested by: Souradeep Chakrabarti <schakrabarti@microsoft.com> MFC after: 2 weeks Sponsored by: Microsoft
* Use KERNEL_PANICKED() in more placesMitchell Horne2022-06-021-1/+1
| | | | | | | | | | This is slightly more optimized than checking panicstr directly. For most of these instances performance doesn't matter, but let's make KERNEL_PANICKED() the common idiom. Reviewed by: mjg MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D35373
* sockets: use socket buffer mutexes in struct socket directlyGleb Smirnoff2022-05-121-2/+2
| | | | | | | | | | | | | | | | | | Since c67f3b8b78e the sockbuf mutexes belong to the containing socket, and socket buffers just point to it. In 74a68313b50 macros that access this mutex directly were added. Go over the core socket code and eliminate code that reaches the mutex by dereferencing the sockbuf compatibility pointer. This change requires a KPI change, as some functions were given the sockbuf pointer only without any hint if it is a receive or send buffer. This change doesn't cover the whole kernel, many protocols still use compatibility pointers internally. However, it allows operation of a protocol that doesn't use them. Reviewed by: markj Differential revision: https://reviews.freebsd.org/D35152
* hyperv: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-0613-44/+14
|
* hyperv: Use __diagused for a variable only used in KASSERT().John Baldwin2022-04-131-1/+1
|
* hyperv storvsc: Remove unused variables.John Baldwin2022-04-061-4/+3
|
* Hyper-V: vPCI: Write back original BAR values after prepopulating barsWei Hu2022-03-301-0/+4
| | | | | | | | | | | | | | In vmbus_pcib_prepopulate_bars(), after writing all 1's to the avialable device bars, those without being configured by device driver are also set to its initialized values. However, this could cause weird problem which results to device failure. The issue has been reported to happen on LSI 9211-8i HBA card for DDA access on Hyper-V. Writing back the orignal BAR values seem to work around this problem. Reported by: Alexander Motin <mavbsd@gmail.com> Tested by: Mathias Kraut <krautmaster@gmail.com> Fixes: 75412a521f6 Hyper-V: vPCI: Prepopulate device bars MFC after: 1 month
* Hyper-V: hn: add switch to turn on and off RSCWei Hu2022-03-154-1/+44
| | | | | | | | | | | | | Currently RSC offloading is enabled by default. With this new change rsc will be disabled by default. By using sysctl we can enable and disable it. Reviewed by: whu Signed-off-by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Fixes: a491581f3f8df Enable vSwitch RSC support in hn netvsc driver MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D34507
* hyperv storvsc: Don't abuse struct sglist to hold virtual addresses.John Baldwin2022-02-011-33/+31
| | | | | | | | | | | struct sglist is intended for holding S/G lists of physical address ranges, not virtual address ranges. GCC 9.x issues several warnings due to casts between pointers and integers of different sizes as a result (vm_paddr_t is 64-bits on i386). Instead, add a local 'struct hv_sglist' which uses an array of 'struct iovec' to hold the S/G list of virtual address ranges. Differential Revision: https://reviews.freebsd.org/D31933
* domains: make domain_init() initialize only global stateGleb Smirnoff2022-01-031-1/+1
| | | | | | | Now that each module handles its global and VNET initialization itself, there is no VNET related stuff left to do in domain_init(). Differential revision: https://reviews.freebsd.org/D33541
* protocols: init with standard SYSINIT(9) or VNET_SYSINITGleb Smirnoff2022-01-032-7/+4
| | | | | | | | | | | | | | | The historical BSD network stack loop that rolls over domains and over protocols has no advantages over more modern SYSINIT(9). While doing the sweep, split global and per-VNET initializers. Getting rid of pr_init allows to achieve several things: o Get rid of ifdef's that protect against double foo_init() when both INET and INET6 are compiled in. o Isolate initializers statically to the module they init. o Makes code easier to understand and maintain. Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D33537
* hyperv: scanning locking is using the bus mtxWarner Losh2021-12-141-15/+14
| | | | | | | | | | The scanning code uses Giant to coordinate its accesses to newbus as well as to synchronize a little state within hyperv's vmbus. Switch to the new bus_topo_* functions instead of referring to Giant explicitly. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D31840
* hn: plug set-but-not-unused varsMateusz Guzik2021-12-101-4/+4
| | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* Create wrapper for Giant taken for newbusWarner Losh2021-12-101-2/+2
| | | | | | | | | | | Create a wrapper for newbus to take giant and for busses to take it too. bus_topo_lock() should be called before interacting with newbus routines and unlocked with bus_topo_unlock(). If you need the topology lock for some reason, bus_topo_mtx() will provide that. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D31831
* ifnet_byindex() actually requires network epochGleb Smirnoff2021-12-061-0/+6
| | | | | | | | | | | | | Sweep over potentially unsafe calls to ifnet_byindex() and wrap them in epoch. Most of the code touched remains unsafe, as the returned pointer is being used after epoch exit. Mark that with a comment. Validate the index argument inside the function, reducing argument validation requirement from the callers and making V_if_index private to if.c. Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D33263
* Revert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816"Cy Schubert2021-12-022-28/+36
| | | | | | | | This reverts commit 266f97b5e9a7958e365e78288616a459b40d924a, reversing changes made to a10253cffea84c0c980a36ba6776b00ed96c3e3b. A mismerge of a merge to catch up to main resulted in files being committed which should not have been.
* wpa: Import wpa_supplicant/hostapd commit 14ab4a816Cy Schubert2021-12-022-36/+28
| | | | | | This is the November update to vendor/wpa committed upstream 2021-11-26. MFC after: 1 month
* hyperv: Flag hn and storvsc statistics with CTLFLAG_STATS.Don Morris2021-12-022-28/+36
| | | | | | Reviewed by: vangyzen, whu, bdrewery Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D30060
* if_hn: Fix a few typos in comments and a sysctl descriptionGordon Bergling2021-11-301-3/+3
| | | | | | - s/segement/segment/ MFC after: 3 days
* Hyper-V: vPCI: Prepopulate device barsWei Hu2021-11-271-0/+43
| | | | | | | | | | | | | | | | In recent Hyper-V releases on Windows Server 2022, vPCI code does not initialize the last 4 bit of device bar registers. This behavior change could result weird problems cuasing PCI code failure when configuring bars. Just write all 1's to those bars whose probed values are not the same as current read ones. This seems to make Hyper-V vPCI and pci_write_bar() to cooperate correctly on these releases. Reported by: khng@freebsd.org Tested by: khng@freebsd.org MFC after: 2 weeks Sponsored by: Microsoft
* hyperv: Register the MSR-based timecounter during SI_SUB_HYPERVISORMark Johnston2021-11-191-9/+7
| | | | | | | | | | | | | This reverts commit 9ef7df022a46 ("hyperv: Register hyperv_timecounter later during boot") and adds a comment explaining why the timecounter needs to be registered as early as it is. PR: 259878 Fixes: 9ef7df022a46 ("hyperv: Register hyperv_timecounter later during boot") Reviewed by: kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33014
* hyperv: Register hyperv_timecounter later during bootMark Johnston2021-10-251-2/+8
| | | | | | | | | | | | | | | | | Previously the MSR-based timecounter was registered during SI_SUB_HYPERVISOR, i.e., very early during boot, and before SI_SUB_LOCK. After commit 621fd9dcb2d8 this triggers a panic since the timecounter list lock is not yet initialized. The hyperv timecounter does not need to be registered so early, so defer that to SI_SUB_DRIVERS, at the same time the hyperv TSC timecounter is registered. Reported by: whu Approved by: whu Fixes: 621fd9dcb2d8 ("timecounter: Lock the timecounter list") MFC after: 1 week Sponsored by: The FreeBSD Foundation
* netvsc: Fix a typo in a commentGordon Bergling2021-10-021-1/+1
| | | | | | - s/prefered/preferred/ MFC after: 3 days
* socket: De-duplicate SBLOCKWAIT() definitionsMark Johnston2021-09-141-1/+0
| | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation
* socket: Rename sb(un)lock() and interlock with listen(2)Mark Johnston2021-09-071-18/+13
| | | | | | | | | | | | | | | | | | | | | | In preparation for moving sockbuf locks into the containing socket, provide alternative macros for the sockbuf I/O locks: SOCK_IO_SEND_(UN)LOCK() and SOCK_IO_RECV_(UN)LOCK(). These operate on a socket rather than a socket buffer. Note that these locks are used only to prevent concurrent readers and writters from interleaving I/O. When locking for I/O, return an error if the socket is a listening socket. Currently the check is racy since the sockbuf sx locks are destroyed during the transition to a listening socket, but that will no longer be true after some follow-up changes. Modify a few places to check for errors from sblock()/SOCK_IO_(SEND|RECV)_LOCK() where they were not before. In particular, add checks to sendfile() and sorflush(). Reviewed by: tuexen, gallatin MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31657
* Hyper-V: hn: Enter network epoch when requiredMichael Tuexen2021-08-261-0/+8
| | | | PR: 254695
* hvsock: fail the probe on non-HyperV machinesKyle Evans2021-08-161-18/+13
| | | | Differential Revision: https://reviews.freebsd.org/D25459