aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hv
Commit message (Collapse)AuthorAgeFilesLines
* Drivers: hv: vmbus: Don't wait after requesting offersK. Y. Srinivasan2015-08-071-11/+1
| | | | | | | | | | | | commit 73cffdb65e679b98893f484063462c045adcf212 upstream. Don't wait after sending request for offers to the host. This wait is unnecessary and simply adds 5 seconds to the boot time. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [bwh: Backported to 3.2: deleted variable t was declared as int] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* Drivers: hv: vmbus: Fix a bug in the error path in vmbus_open()K. Y. Srinivasan2015-08-071-2/+5
| | | | | | | | | | | commit 40384e4bbeb9f2651fe9bffc0062d9f31ef625bf upstream. Correctly rollback state if the failure occurs after we have handed over the ownership of the buffer to the host. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* Drivers: hv: vmbus: incorrect device name is printed when child device is ↵Fernando Soto2015-03-061-4/+4
| | | | | | | | | | | | | | | | | | | unregistered commit 84672369ffb98a51d4ddf74c20a23636da3ad615 upstream. 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> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* Drivers: hv: vmbus: Cleanup hv_post_message()K. Y. Srinivasan2014-12-142-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit b29ef3546aecb253a5552b198cef23750d56e1e4 upstream. Minimize failures in this function by pre-allocating the buffer for posting messages. The hypercall for posting the message can fail for a number of reasons: 1. Transient resource related issues 2. Buffer alignment 3. Buffer cannot span a page boundry We address issues 2 and 3 by preallocating a per-cpu page for the buffer. Transient resource related failures are handled by retrying by the callers of this function. This patch is based on the investigation done by Dexuan Cui <decui@microsoft.com>. I would like to thank Sitsofe Wheeler <sitsofe@yahoo.com> for reporting the issue and helping in debuggging. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com> Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [bwh: Backported to 3.2: - s/NR_CPUS/MAX_NUM_CPUS/ - Adjust context, indentation - Also free the page in hv_synic_init() error path] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* Drivers: hv: vmbus: Cleanup vmbus_close_internal()K. Y. Srinivasan2014-12-141-4/+21
| | | | | | | | | | | | | | | | | | commit 98d731bb064a9d1817a6ca9bf8b97051334a7cfe upstream. Eliminate calls to BUG_ON() in vmbus_close_internal(). We have chosen to potentially leak memory, than crash the guest in case of failures. In this version of the patch I have addressed comments from Dan Carpenter (dan.carpenter@oracle.com). Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [bwh: Backported to 3.2: function is extern; don't change the return type to int as callers will ignore the value] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* Drivers: hv: vmbus: Fix a bug in vmbus_open()K. Y. Srinivasan2014-12-141-1/+3
| | | | | | | | | | | | | commit 45d727cee9e200f5b351528b9fb063b69cf702c8 upstream. Fix a bug in vmbus_open() and properly propagate the error. I would like to thank Dexuan Cui <decui@microsoft.com> for identifying the issue. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* Drivers: hv: vmbus: Cleanup vmbus_establish_gpadl()K. Y. Srinivasan2014-12-141-4/+1
| | | | | | | | | | | | | commit 72c6b71c245dac8f371167d97ef471b367d0b66b upstream. Eliminate the call to BUG_ON() by waiting for the host to respond. We are trying to reclaim the ownership of memory that was given to the host and so we will have to wait until the host responds. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* Drivers: hv: vmbus: Cleanup vmbus_teardown_gpadl()K. Y. Srinivasan2014-12-141-5/+6
| | | | | | | | | | | | | | | commit 66be653083057358724d56d817e870e53fb81ca7 upstream. Eliminate calls to BUG_ON() by properly handling errors. In cases where rollback is possible, we will return the appropriate error to have the calling code decide how to rollback state. In the case where we are transferring ownership of the guest physical pages to the host, we will wait for the host to respond. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* Drivers: hv: vmbus: Cleanup vmbus_post_msg()K. Y. Srinivasan2014-12-141-3/+14
| | | | | | | | | | | | | | | | commit fdeebcc62279119dbeafbc1a2e39e773839025fd upstream. Posting messages to the host can fail because of transient resource related failures. Correctly deal with these failures and increase the number of attempts to post the message before giving up. In this version of the patch, I have normalized the error code to Linux error code. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* drivers: hv: additional switch to use mb() instead of smp_mb()Qiang Huang2014-04-301-1/+1
| | | | | | | | | commit e4af376d04b0(drivers: hv: switch to use mb() instead of smp_mb()), the adjustment mistakenly dropped the change in hv_ringbuffer_read, so add it. Signed-off-by: Qiang Huang <h.huangqiang@huawei.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* Drivers: hv: vmbus: Don't timeout during the initial connection with hostK. Y. Srinivasan2014-04-021-11/+1
| | | | | | | | | | | | | | | | | | | commit 269f979467cf49f2ea8132316c1f00f8c9678f7c upstream. When the guest attempts to connect with the host when there may already be a connection with the host (as would be the case during the kdump/kexec path), it is difficult to guarantee timely response from the host. Starting with WS2012 R2, the host supports this ability to re-connect with the host (explicitly to support kexec). Prior to responding to the guest, the host needs to ensure that device states based on the previous connection to the host have been properly torn down. This may introduce unbounded delays. To deal with this issue, don't do a timed wait during the initial connect with the host. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* drivers: hv: switch to use mb() instead of smp_mb()Jason Wang2013-07-272-2/+2
| | | | | | | | | | | | | | | | | commit 35848f68b07df3f917cb13fc3c134718669f569b upstream. 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> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [bwh: Backported to 3.2: - Drop changes to functions that don't exist here - hv_ringbuffer_write() has only a write memory barrier] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* NLS: improve UTF8 -> UTF16 string conversion routineAlan Stern2013-03-201-4/+6
| | | | | | | | | | | | | | | | | | | | | | | commit 0720a06a7518c9d0c0125bd5d1f3b6264c55c3dd upstream. The utf8s_to_utf16s conversion routine needs to be improved. Unlike its utf16s_to_utf8s sibling, it doesn't accept arguments specifying the maximum length of the output buffer or the endianness of its 16-bit output. This patch (as1501) adds the two missing arguments, and adjusts the only two places in the kernel where the function is called. A follow-on patch will add a third caller that does utilize the new capabilities. The two conversion routines are still annoyingly inconsistent in the way they handle invalid byte combinations. But that's a subject for a different patch. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* Drivers: hv: Cleanup error handling in vmbus_open()K. Y. Srinivasan2012-10-301-11/+13
| | | | | | | | | | | | | commit 1392550240aaa72ce3a094a38bd23525cd67ce60 upstream. Fix a memory leak in the error handling path in the function vmbus_open(). Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Reported-by: Jason Wang <jasowang@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* Drivers:hv: Fix a bug in vmbus_driver_unregister()K. Y. Srinivasan2012-01-121-4/+1
| | | | | | | | | | | | | | | | commit 8f257a142fc3868d69de3f996b95d7bdbc509560 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* drivers: hv: Don't OOPS when you cannot init vmbusK. Y. Srinivasan2012-01-121-0/+16
| | | | | | | | | | | | | | commit cf6a2eacbcb2593b5b91d0817915c4f0464bb534 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* hv: remove struct hv_device_info from hyperv.hGreg Kroah-Hartman2011-10-111-0/+19
| | | | | | | 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>
* hv: remove free_channel() from hyperv.hGreg Kroah-Hartman2011-10-111-1/+1
| | | | | | | | This function is only used in the file it is declared in (channel_mgmt.c) so make it static and remove it from the hyperv.h file. Cc: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: hv: remove vmbus_loglevel as it is not used at all anymoreGreg Kroah-Hartman2011-10-111-5/+0
| | | | | | | | | 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>
* Staging: hv: remove last user of DPRINT() macroGreg Kroah-Hartman2011-10-112-33/+0
| | | | | | | This also removed the unused function hv_dump_ring_info(). Cc: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* hv: rename prep_negotiate_resp() to vmbus_prep_negotiate_resp()Greg Kroah-Hartman2011-10-113-9/+8
| | | | | | | | It's a global symbol, so properly prefix it and use the proper EXPORT value as well. Cc: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: hv: remove unneeded asm include file in hyperv.hGreg Kroah-Hartman2011-10-113-3/+3
| | | | | | | | 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>
* Staging: hv: move hyperv code out of staging directoryGreg Kroah-Hartman2011-10-1012-0/+5034
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>