summaryrefslogtreecommitdiff
path: root/sys/modules/hyperv
AgeCommit message (Collapse)Author
2024-07-15Remove residual blank line at start of MakefileWarner Losh
This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
2024-06-07Hyper-V: TLB flush enlightment using hypercallSouradeep Chakrabarti
Currently FreeBSD uses IPI based TLB flushing for remote TLB flushing. Hyper-V allows hypercalls to flush local and remote TLB. The use of Hyper-V hypercalls gives significant performance improvement in TLB operations. This patch set during test has shown near to 40 percent TLB performance improvement. Also this patch adds rep hypercall implementation as well. Reviewed by: whu, kib Tested by: whu Authored-by: Souradeep Chakrabarti <schakrabarti@microsoft.com> Co-Authored-by: Erni Sri Satya Vennela <ernis@microsoft.com> MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D45521
2023-08-16sys: Remove $FreeBSD$: one-line sh patternWarner Losh
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-02-05hv_hid: Hyper-V HID driverYuri
Hyper-V HID driver using hidbus/hms. Reviewed by: wulf MFC after: 1 week PR: 221074 Differential revision: https://reviews.freebsd.org/D38140
2022-10-27arm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 3, final)Souradeep Chakrabarti
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
2021-11-18Fix some modules to export more used symbolsKonstantin Belousov
and remove non-present symbols that are now reported by kmod_syms.awk. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32878
2021-06-08hyperv: Fix vmbus after the i386 4/4 splitMark Johnston
The vmbus ISR needs to live in a trampoline. Dynamically allocating a trampoline at driver initialization time poses some difficulties due to the fact that the KENTER macro assumes that the offset relative to tramp_idleptd is fixed at static link time. Another problem is that native_lapic_ipi_alloc() uses setidt(), which assumes a fixed trampoline offset. Rather than fight this, move the Hyper-V ISR to i386/exception.s. Add a new HYPERV kernel option to make this optional, and configure it by default on i386. This is sufficient to make use of vmbus(4) after the 4/4 split. Note that vmbus cannot be loaded dynamically and both the HYPERV option and device must be configured together. I think this is not too onerous a requirement, since vmbus(4) was previously non-functional. Reported by: Harry Schmalzbauer <freebsd@omnilan.de> Tested by: Harry Schmalzbauer <freebsd@omnilan.de> Reviewed by: whu, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30577
2020-05-31Fix directly building in sys/modulesLi-Wen Hsu
Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=361660
2020-05-20HyperV socket implementation for FreeBSDWei Hu
This change adds Hyper-V socket feature in FreeBSD. New socket address family AF_HYPERV and its kernel support are added. Submitted by: Wei Hu <weh@microsoft.com> Reviewed by: Dexuan Cui <decui@microsoft.com> Relnotes: yes Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D24061 Notes: svn path=/head/; revision=361275
2018-04-06Move most of the contents of opt_compat.h to opt_global.h.Brooks Davis
opt_compat.h is mentioned in nearly 180 files. In-progress network driver compabibility improvements may add over 100 more so this is closer to "just about everywhere" than "only some files" per the guidance in sys/conf/options. Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of sys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.h is created on all architectures. Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the set of compiled files. Reviewed by: kib, cem, jhb, jtl Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14941 Notes: svn path=/head/; revision=332122
2018-03-20Rename assym.s to assym.incEd Maste
assym is only to be included by other .s files, and should never actually be assembled by itself. Reviewed by: imp, bdrewery (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14180 Notes: svn path=/head/; revision=331254
2018-03-17Move assym.s to DPSRCS in vmbus moduleEd Maste
assym.s is only to be included by other .s files, and should not actually be assembled by itself. Notes: svn path=/head/; revision=331096
2017-05-10hyperv/vmbus: Reorganize vmbus device treeSepherosa Ziehau
For GEN1 Hyper-V, vmbus is attached to pcib0, which contains the resources for PCI passthrough and SR-IOV. There is no acpi_syscontainer0 on GEN1 Hyper-V. For GEN2 Hyper-V, vmbus is attached to acpi_syscontainer0, which contains the resources for PCI passthrough and SR-IOV. There is no pcib0 on GEN2 Hyper-V. The ACPI VMBUS device now only holds its _CRS, which is empty as of this commit; its existence is mainly for upward compatibility. Device tree structure is suggested by jhb@. Tested-by: dexuan@ Collabrated-wth: dexuan@ MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D10565 Notes: svn path=/head/; revision=318136
2017-03-04sys/modules: normalize .CURDIR-relative paths to SRCTOPEnji Cooper
This simplifies make output/logic Tested with: `cd sys/modules; make ALL_MODULES=` on amd64 MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314651
2016-12-20hyperv/ic: Rename cleaned up files.Sepherosa Ziehau
MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8850 Notes: svn path=/head/; revision=310324
2016-12-20hyperv/ic: Rname cleaned up file.Sepherosa Ziehau
MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8848 Notes: svn path=/head/; revision=310317
2016-12-01hyperv/hn: Add 'options RSS' support.Sepherosa Ziehau
Reviewed by: adrian MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8676 Notes: svn path=/head/; revision=309353
2016-12-01hyperv/hn: Add HN_DEBUG kernel option.Sepherosa Ziehau
If bufring is used for per-TX ring descs, don't update "available" counter, which is only used to help debugging. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8674 Notes: svn path=/head/; revision=309346
2016-11-18hyperv/pcib: change the file name: pcib.c -> vmbus_pcib.cDexuan Cui
This makes the file name and the variable naming in the file consistent. Reviewed by: sephe Approved by: sephe (mentor) MFC after: 1 week Sponsored by: Microsoft Notes: svn path=/head/; revision=308795
2016-11-18hyperv/pcib: Fix the build for some kernel configsDexuan Cui
Add the dependency on pci explicitly for the pcib and vmbus drivers. The related Makefiles are updated accordingly too. Reviewed by: sephe Approved by: sephe (mentor) MFC after: 1 week Sponsored by: Microsoft Notes: svn path=/head/; revision=308793
2016-11-16hyperv/pcib: enable PCIe pass-through (a.k.a. Discrete Device Assignment)Dexuan Cui
The feature enables us to pass through physical PCIe devices to FreeBSD VM running on Hyper-V (Windows Server 2016) to get near-native performance with low CPU utilization. The patch implements a PCI bridge driver to support the feature: 1) The pcib driver talks to the host to discover device(s) and presents the device(s) to FreeBSD's pci driver via PCI configuration space (note: to access the configuration space, we don't use the standard I/O port 0xCF8/CFC method; instead, we use an MMIO-based method supplied by Hyper-V, which is very similar to the 0xCF8/CFC method). 2) The pcib driver allocates resources for the device(s) and initialize the related BARs, when the device driver's attach method is invoked; 3) The pcib driver talks to the host to create MSI/MSI-X interrupt remapping between the guest and the host; 4) The pcib driver supports device hot add/remove. Reviewed by: sephe Approved by: sephe (mentor) MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8332 Notes: svn path=/head/; revision=308725
2016-11-15hyperv/vss: Add driver and tools for VSSSepherosa Ziehau
VSS stands for "Volume Shadow Copy Service". Unlike virtual machine snapshot, it only takes snapshot for the virtual disks, so both filesystem and applications have to aware of it, and cooperate the whole VSS process. This driver exposes two device files to the userland: /dev/hv_fsvss_dev Normally userland programs should _not_ mess with this device file. It is currently used by the hv_vss_daemon(8), which freezes and thaws the filesystem. NOTE: currently only UFS is supported, if the system mounts _any_ other filesystems, the hv_vss_daemon(8) will veto the VSS process. If hv_vss_daemon(8) was disabled, then this device file must be opened, and proper ioctls must be issued to keep the VSS working. /dev/hv_appvss_dev Userland application can opened this device file to receive the VSS freeze notification, hold the VSS for a while (mainly to flush application data to filesystem), release the VSS process, and receive the VSS thaw notification i.e. applications can run again. The VSS will still work, even if this device file is not opened. However, only filesystem consistency is promised, if this device file is not opened or is not operated properly. hv_vss_daemon(8) is started by devd(8) by default. It can be disabled by editting /etc/devd/hyperv.conf. Submitted by: Hongjiang Zhang <honzhan microsoft com> Reviewed by: kib, mckusick MFC after: 3 weeks Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8224 Notes: svn path=/head/; revision=308664
2016-11-01hyperv/hn: Rename cleaned up file.Sepherosa Ziehau
MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8390 Notes: svn path=/head/; revision=308163
2016-10-31hyperv/hn: Rename cleaned up RNDIS source file.Sepherosa Ziehau
MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8361 Notes: svn path=/head/; revision=308116
2016-10-28hyperv/hn: Rename cleaned up NVS source file.Sepherosa Ziehau
MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8354 Notes: svn path=/head/; revision=308012
2016-09-30hyperv/vmbus: Add missing vmbus_if.c to module build.Sepherosa Ziehau
MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8067 Notes: svn path=/head/; revision=306484
2016-09-29hyperv/storvsc: Fix the blkvsc disk attachment issues.Sepherosa Ziehau
- The original 'disengage' ATA controller model does not work properly for all possible disk configurations. Use the newly added ATA disk veto eventhandler to fit into all possible disk configuration. - If the 'invalid LUN' happens on blkvsc controllers, return CAM_DEV_NOT_THERE so that CAM will not destroy attached disks under the blkvsc controllers. Submitted by: Hongjiang Zhang <honzhan microsoft com> Discussed with: mav MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7693 Notes: svn path=/head/; revision=306426
2016-08-11hyperv/vmbus: Add APIs for various types of transactions.Sepherosa Ziehau
Reviewed by: Jun Su <junsu microsoft com> MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7456 Notes: svn path=/head/; revision=303947
2016-07-27opt_apic.h is only used on i386.Bryan Drewery
MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=303415
2016-07-27hyperv/vmbus: Rename cleaned up bufring codeSepherosa Ziehau
MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7318 Notes: svn path=/head/; revision=303379
2016-07-19hyperv/vmbus: Rename laundered vmbus channel codeSepherosa Ziehau
MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7232 Notes: svn path=/head/; revision=303023
2016-07-15hyperv/vmbus: Merge hv_channel_mgmt.c into hv_channel.cSepherosa Ziehau
MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7126 Notes: svn path=/head/; revision=302864
2016-07-13hyperv/vmbus: Add vmbus method for GUID base device probing.Sepherosa Ziehau
Reduce the exposure of hv_device. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7024 Notes: svn path=/head/; revision=302698
2016-07-13hyperv/vmbus: Merge hv_connection.c into hv_channel.cSepherosa Ziehau
MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7004 Notes: svn path=/head/; revision=302692
2016-07-12hyperv/vmbus: Rework vmbus version accessing.Sepherosa Ziehau
Instead of global variable, vmbus version is accessed through a vmbus DEVMETHOD now. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6953 Notes: svn path=/head/; revision=302629
2016-06-06hyperv: Move machine dependent bits into machine dependent files.Sepherosa Ziehau
MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6701 Notes: svn path=/head/; revision=301483
2016-06-01hyperv: Rename some cleaned up/almost cleaned up filesSepherosa Ziehau
MFC after: 1 week Sponsored by: Microsoft OSTC Notes: svn path=/head/; revision=301113
2016-05-23hyperv: Add helpers for busdma(9) operationSepherosa Ziehau
MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6443 Notes: svn path=/head/; revision=300478
2016-04-15hyperv: Deprecate HYPERV option by moving Hyper-V IDT vector into vmbusSepherosa Ziehau
Submitted by: Jun Su <junsu microsoft com> Reviewed by: jhb, kib, sephe Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5910 Notes: svn path=/head/; revision=298022
2016-02-24hyperv/utils: Code rearrange and cleanupSepherosa Ziehau
Split heartbeat, shutdown and timesync out of utils code and name them properly. Submitted by: Jun Su <junsu microsoft com> Reviewed by: adrian, sephe, Hongjiang Zhang <honzhan microsoft com> MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5216 Notes: svn path=/head/; revision=295958
2016-01-14Unbreak `make depend` with sys/modules/hyperv/vmbus after r293870Enji Cooper
Pointyhat to: sephe Notes: svn path=/head/; revision=293877
2016-01-14hyperv: implement an event timerSepherosa Ziehau
Submitted by: Howard Su <howard0su@gmail.com> Reviewed by: delphij, royger, adrian Approved by: adrian (mentor) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4676 Notes: svn path=/head/; revision=293873
2015-06-30- Fix `make depend` in sys/modulesLi-Wen Hsu
Differential Revision: https://reviews.freebsd.org/D2951 Approved by: delphij Notes: svn path=/head/; revision=284969
2014-09-13Import HyperV Key-Value Pair (KVP) driver and daemon code by Microsoft,Xin LI
many thanks for their continued support of FreeBSD. While I'm there, also implement a new build knob, WITHOUT_HYPERV to disable building and installing of the HyperV utilities when necessary. The HyperV utilities are only built for i386 and amd64 targets. This is a stable/10 candidate for inclusion with 10.1-RELEASE. Submitted by: Wei Hu <weh microsoft com> MFC after: 1 week Notes: svn path=/head/; revision=271493
2013-09-28Fix make depend, apply a bit of style.Ulrich Spörlein
Approved by: re (marius) Reviewed by: grehan Notes: svn path=/head/; revision=255923
2013-09-14Fix module build when device ata is not in kernel config.Konstantin Belousov
Sponsored by: The FreeBSD Foundation Build-tested by: gjb Approved by: re (delphij) Notes: svn path=/head/; revision=255561
2013-09-09Revert the kvp code - there's still some work thatPeter Grehan
needs to be done for that. Discussed with: Microsoft hyper-v devs Notes: svn path=/projects/hyperv/; revision=255427
2013-09-09Latest update from Microsoft.Peter Grehan
Obtained from: Microsoft Hyper-v dev team Notes: svn path=/projects/hyperv/; revision=255414
2013-07-17Microsoft have changed their policy on how the hyper-v code willPeter Grehan
be pulled into FreeBSD. From now, FreeBSD will be considered the upstream repo. First step: move the drivers away from the contrib area and into the base system. A follow-on commit will include the drivers in the amd64 GENERIC kernel. Notes: svn path=/projects/hyperv/; revision=253411
2013-07-03Connect the stordisengage driver to the build.Peter Grehan
Notes: svn path=/projects/hyperv/; revision=252649