summaryrefslogtreecommitdiffstats
path: root/drivers/hv/vmbus_drv.c
AgeCommit message (Collapse)Author
2013-12-07ACPI: Clean up inclusions of ACPI header filesLv Zheng
Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h> inclusions and remove some inclusions of those files that aren't necessary. First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h> should not be included directly from any files that are built for CONFIG_ACPI unset, because that generally leads to build warnings about undefined symbols in !CONFIG_ACPI builds. For CONFIG_ACPI set, <linux/acpi.h> includes those files and for CONFIG_ACPI unset it provides stub ACPI symbols to be used in that case. Second, there are ordering dependencies between those files that always have to be met. Namely, it is required that <acpi/acpi_bus.h> be included prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the latter depends on are always there. And <acpi/acpi.h> which provides basic ACPICA type declarations should always be included prior to any other ACPI headers in CONFIG_ACPI builds. That also is taken care of including <linux/acpi.h> as appropriate. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Tony Luck <tony.luck@intel.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> (drivers/pci stuff) Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> (Xen stuff) Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-09-26hv: move ringbuffer bus attributes to dev_groupsGreg Kroah-Hartman
This moves the ringbuffer bus attributes to the dev_groups structure, deletes the now unneeded struct hv_device_info, and removes some now unused functions, and variables as everything is now moved to the dev_groups structure, dev_attrs is no longer needed. Tested-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26hv: delete struct hv_dev_port_infoGreg Kroah-Hartman
It's no longer needed, and the struct hv_ring_buffer_debug_info structure shouldn't be "global" so move it to the local .h file instead. Tested-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26hv: delete vmbus_get_debug_info()Greg Kroah-Hartman
It's only used once, only contains 2 function calls, so just make those calls directly, deleting the function, and the now unneeded structure entirely. Tested-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26hv: move "client/server_monitor_conn_id" bus attributes to dev_groupsGreg Kroah-Hartman
This moves the "client_monitor_conn_id" and "server_monitor_conn_id" bus attributes to the dev_groups structure, removing the need for it to be in a temporary structure. Tested-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26hv: move "client/server_monitor_latency" bus attributes to dev_groupsGreg Kroah-Hartman
This moves the "client_monitor_latency" and "server_monitor_latency" bus attributes to the dev_groups structure, removing the need for it to be in a temporary structure. Tested-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26hv: move "client/server_monitor_pending" bus attributes to dev_groupsGreg Kroah-Hartman
This moves the "client_monitor_pending" and "server_monitor_pending" bus attributes to the dev_groups structure, removing the need for it to be in a temporary structure. Tested-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26hv: move "device_id" bus attribute to dev_groupsGreg Kroah-Hartman
This moves the "device_id" bus attribute to the dev_groups structure, removing the need for it to be in a temporary structure. Tested-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26hv: move "class_id" bus attribute to dev_groupsGreg Kroah-Hartman
This moves the "class_id" bus attribute to the dev_groups structure, removing the need for it to be in a temporary structure. Tested-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26hv: move "modalias" bus attribute to dev_groupsGreg Kroah-Hartman
This moves the "state" bus attribute to the dev_groups structure. Tested-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26hv: move "monitor_id" bus attribute to dev_groupsGreg Kroah-Hartman
This moves the "state" bus attribute to the dev_groups structure, removing the need for it to be in a temporary structure. Tested-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26hv: move "state" bus attribute to dev_groupsGreg Kroah-Hartman
This moves the "state" bus attribute to the dev_groups structure, removing the need for it to be in a temporary structure. Tested-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26hv: use dev_groups for device attributesGreg Kroah-Hartman
This patch is the first in a series that moves the hv bus code to use the dev_groups field instead of dev_attrs, as dev_attrs is going away in future kernel releases. It moves the id sysfs file to the dev_groups structure, and creates the needed show/store functions, instead of relying on one "universal" function for this. By doing this, it removes the need for this to be in a temporary structure. Tested-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-02Drivers: hv: remove HV_DRV_VERSIONOlaf Hering
Remove HV_DRV_VERSION, it has no meaning for upstream drivers. Initially it was supposed to show the "Linux Integration Services" version, now it is not in sync anymore with the out-of-tree drivers available from the MSFT website. The only place where a version string is still required is the KVP command "IntegrationServicesVersion" which is handled by tools/hv/hv_kvp_daemon.c. To satisfy such KVP request from the host pass the current string to the daemon during KVP userland registration. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-16Drivers: hv: vmbus: incorrect device name is printed when child device is ↵Fernando Soto
unregistered Whenever a device is unregistered in vmbus_device_unregister (drivers/hv/vmbus_drv.c), the device name in the log message may contain garbage as the memory has already been freed by the time pr_info is called. Log example: [ 3149.170475] hv_vmbus: child device àõsèè0_5 unregistered By logging the message just before calling device_unregister, the correct device name is printed: [ 3145.034652] hv_vmbus: child device vmbus_0_5 unregistered Also changing register & unregister messages to debug to avoid unnecessarily cluttering the kernel log. Signed-off-by: Fernando M Soto <fsoto@bluecatnetworks.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-24drivers: hv: allocate synic structures before hv_synic_init()Jason Wang
We currently allocate synic structures in hv_sync_init(), but there's no way for the driver to know about the allocation failure and it may continue to use the uninitialized pointers. Solve this by introducing helpers for allocating and freeing and doing the allocation before the on_each_cpu() call in vmbus_bus_init(). Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-18drivers: hv: switch to use mb() instead of smp_mb()Jason Wang
Even if guest were compiled without SMP support, it could not assume that host wasn't. So switch to use mb() instead of smp_mb() to force memory barriers for UP guest. Signed-off-by: Jason Wang <jasowang@redhat.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-27Drivers: hv: vmbus: Use the new infrastructure for delivering VMBUS interruptsK. Y. Srinivasan
Use the infrastructure for delivering VMBUS interrupts using a special vector. With this patch, we can now properly handle the VMBUS interrupts that can be delivered on any CPU. Also, turn on interrupt load balancing as well. This patch requires the infrastructure that was implemented in the patch: X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-18Drivers: hv: vmbus_flow_handler() can be staticFengguang Wu
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17Drivers: hv: Add a check to deal with spurious interruptsK. Y. Srinivasan
We establish the handler before we have fully initialized the VMBUS state. Deal with spurious interrupts. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17Drivers: hv: Handle vmbus interrupts concurrently on all cpusK. Y. Srinivasan
Vmbus interrupts are unique in that while the interrupt is delivered on a given vector, these can be handled concurrently on different CPUs. Handle the vmbus interrupts concurrently on all the CPUs. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17Drivers: hv: Manage event tasklets on per-cpu basisK. Y. Srinivasan
Now that we can potentially take vmbus interrupts on any CPU, make the tasklets per-CPU. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17Drivers: hv: Get rid of unnecessary request for offersK. Y. Srinivasan
This call to seek offers is not necessary and just adds unnecessary delay. Get rid of it. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17Drivers: hv: Modify the interrupt handling code to support win8 and beyondK. Y. Srinivasan
Starting with Win8 (WS2012), the event page can be used to directly get the channel ID that needs servicing. Modify the channel event handling code to take advantage of this feature. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04hv: vmbus_drv: detect hyperv through x86_hyperJason Wang
There are two reasons we need to use x86_hyper instead of query_hypervisor_presence(): - Not only hyperv but also other hypervisors such as kvm would set X86_FEATURE_HYTPERVISOR, so query_hypervisor_presence() will return true even in kvm. This may cause extra delay of 5 seconds before failing the probing in kvm guest. - The hypervisor has been detected in init_hypervisor(), so no need to do the work again. Signed-off-by: Jason Wang <jasowang@redhat.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Acked-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-17hv: fail the probing immediately when we are not in hyperv platformJason Wang
We wait for about 5 seconds for the success of the hyperv registration even if we were not in hyperv platform. This is suboptimal, so the patch check the cpuid in the beginning of hv_acpi_init() instead of in vmbus_bus_init() to fail the probing immediately. Signed-off-by: Jason Wang <jasowang@redhat.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Acked-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-13Drivers: hv: vmbus: Use the standard format string to format GUIDsK. Y. Srinivasan
Format GUIDS as per MSFT standard. This makes interacting with MSFT tool stack easier. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: Olaf Hering <olaf@aepfle.de> Reviewed-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-19drivers: hv: remove IRQF_SAMPLE_RANDOM which is now a no-opTheodore Ts'o
With the changes in the random tree, IRQF_SAMPLE_RANDOM is now a no-op; interrupt randomness is now collected unconditionally in a very low-overhead fashion; see commit 775f4b297b. The IRQF_SAMPLE_RANDOM flag was scheduled to be removed in 2009 on the feature-removal-schedule, so this patch is preparation for the final removal of this flag. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Acked-by: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com>
2012-01-04Drivers:hv: Fix a bug in vmbus_driver_unregister()K. Y. Srinivasan
The function vmbus_exists() was introduced recently to deal with cases where the vmbus driver failed to initialize and yet other Hyper-V drivers attempted to register with the vmbus bus driver. This patch introduced a bug where vmbus_driver_unregister() would fail to unregister the driver. This patch fixes the problem. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Fuzhou Chen <fuzhouch@microsoft.com> Cc: Sasha Levin <levinsasha928@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-12Drivers: hv: Make the vmbus driver unloadableK. Y. Srinivasan
It turns out that the vmbus driver can be made unloadable. Make it unloadable. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09drivers: hv: Don't OOPS when you cannot init vmbusK. Y. Srinivasan
The hv vmbus driver was causing an OOPS since it was trying to register drivers on top of the bus even if initialization of the bus has failed for some reason (such as the odd chance someone would run a hv enabled kernel in a non-hv environment). Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26Staging: hv: vmbus: Support building the vmbus driver as part of the kernelK. Y. Srinivasan
Modify the way we initialize the vmbus driver so that all the hyper-v drivers can be linked with the kernel and still ensure that the vmbus driver is fully initialized before the drivers that depend upon the vmbus driver attempt to initialize. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11hv: remove struct hv_device_info from hyperv.hGreg Kroah-Hartman
This is only used/needed by the vmbus core code, so move it out of the hyperv.h file and into the .c file that uses it. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11Staging: hv: remove vmbus_loglevel as it is not used at all anymoreGreg Kroah-Hartman
As there is no user of this variable, it's time to delete it. For dynamic debugging of the hyperv code, use the standard dynamic debug kernel interface. Cc: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-11Staging: hv: remove unneeded asm include file in hyperv.hGreg Kroah-Hartman
No one outside of the hyperv core needs to include the asm/hyperv.h file, so don't put it in the "global" include/linux/hyperv.h file. Cc: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-10Staging: hv: move hyperv code out of staging directoryGreg Kroah-Hartman
After many years wandering the desert, it is finally time for the Microsoft HyperV code to move out of the staging directory. Or at least the core hyperv bus code, and the utility driver, the rest still have some review to get through by the various subsystem maintainers. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>