Commit 0dd0c8f7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull Hyper-V updates from Sasha Levin:

 - support for new VMBus protocols (Andrea Parri)

 - hibernation support (Dexuan Cui)

 - latency testing framework (Branden Bonaby)

 - decoupling Hyper-V page size from guest page size (Himadri Pandya)

* tag 'hyperv-next-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: (22 commits)
  Drivers: hv: vmbus: Fix crash handler reset of Hyper-V synic
  drivers/hv: Replace binary semaphore with mutex
  drivers: iommu: hyperv: Make HYPERV_IOMMU only available on x86
  HID: hyperv: Add the support of hibernation
  hv_balloon: Add the support of hibernation
  x86/hyperv: Implement hv_is_hibernation_supported()
  Drivers: hv: balloon: Remove dependencies on guest page size
  Drivers: hv: vmbus: Remove dependencies on guest page size
  x86: hv: Add function to allocate zeroed page for Hyper-V
  Drivers: hv: util: Specify ring buffer size using Hyper-V page size
  Drivers: hv: Specify receive buffer size using Hyper-V page size
  tools: hv: add vmbus testing tool
  drivers: hv: vmbus: Introduce latency testing
  video: hyperv: hyperv_fb: Support deferred IO for Hyper-V frame buffer driver
  video: hyperv: hyperv_fb: Obtain screen resolution from Hyper-V host
  hv_netvsc: Add the support of hibernation
  hv_sock: Add the support of hibernation
  video: hyperv_fb: Add the support of hibernation
  scsi: storvsc: Add the support of hibernation
  Drivers: hv: vmbus: Add module parameter to cap the VMBus version
  ...
parents 8fa91bfa 7a1323b5
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
What:           /sys/kernel/debug/hyperv/<UUID>/fuzz_test_state
Date:           October 2019
KernelVersion:  5.5
Contact:        Branden Bonaby <brandonbonaby94@gmail.com>
Description:    Fuzz testing status of a vmbus device, whether its in an ON
                state or a OFF state
Users:          Debugging tools

What:           /sys/kernel/debug/hyperv/<UUID>/delay/fuzz_test_buffer_interrupt_delay
Date:           October 2019
KernelVersion:  5.5
Contact:        Branden Bonaby <brandonbonaby94@gmail.com>
Description:    Fuzz testing buffer interrupt delay value between 0 - 1000
		 microseconds (inclusive).
Users:          Debugging tools

What:           /sys/kernel/debug/hyperv/<UUID>/delay/fuzz_test_message_delay
Date:           October 2019
KernelVersion:  5.5
Contact:        Branden Bonaby <brandonbonaby94@gmail.com>
Description:    Fuzz testing message delay value between 0 - 1000 microseconds
		 (inclusive).
Users:          Debugging tools
+1 −0
Original line number Diff line number Diff line
@@ -7654,6 +7654,7 @@ F: include/uapi/linux/hyperv.h
F:	include/asm-generic/mshyperv.h
F:	tools/hv/
F:	Documentation/ABI/stable/sysfs-bus-vmbus
F:	Documentation/ABI/testing/debugfs-hyperv
HYPERBUS SUPPORT
M:	Vignesh Raghavendra <vigneshr@ti.com>
+15 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
 * Author : K. Y. Srinivasan <kys@microsoft.com>
 */

#include <linux/acpi.h>
#include <linux/efi.h>
#include <linux/types.h>
#include <asm/apic.h>
@@ -45,6 +46,14 @@ void *hv_alloc_hyperv_page(void)
}
EXPORT_SYMBOL_GPL(hv_alloc_hyperv_page);

void *hv_alloc_hyperv_zeroed_page(void)
{
        BUILD_BUG_ON(PAGE_SIZE != HV_HYP_PAGE_SIZE);

        return (void *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
}
EXPORT_SYMBOL_GPL(hv_alloc_hyperv_zeroed_page);

void hv_free_hyperv_page(unsigned long addr)
{
	free_page(addr);
@@ -437,3 +446,9 @@ bool hv_is_hyperv_initialized(void)
	return hypercall_msr.enable;
}
EXPORT_SYMBOL_GPL(hv_is_hyperv_initialized);

bool hv_is_hibernation_supported(void)
{
	return acpi_sleep_state_supported(ACPI_STATE_S4);
}
EXPORT_SYMBOL_GPL(hv_is_hibernation_supported);
+1 −0
Original line number Diff line number Diff line
@@ -219,6 +219,7 @@ static inline struct hv_vp_assist_page *hv_get_vp_assist_page(unsigned int cpu)
void __init hyperv_init(void);
void hyperv_setup_mmu_ops(void);
void *hv_alloc_hyperv_page(void);
void *hv_alloc_hyperv_zeroed_page(void);
void hv_free_hyperv_page(unsigned long addr);
void hyperv_reenlightenment_intr(struct pt_regs *regs);
void set_hv_tscchange_cb(void (*cb)(void));
+34 −0
Original line number Diff line number Diff line
@@ -192,6 +192,9 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
	if (desc->bLength == 0)
		goto cleanup;

	/* The pointer is not NULL when we resume from hibernation */
	if (input_device->hid_desc != NULL)
		kfree(input_device->hid_desc);
	input_device->hid_desc = kmemdup(desc, desc->bLength, GFP_ATOMIC);

	if (!input_device->hid_desc)
@@ -203,6 +206,9 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
		goto cleanup;
	}

	/* The pointer is not NULL when we resume from hibernation */
	if (input_device->report_desc != NULL)
		kfree(input_device->report_desc);
	input_device->report_desc = kzalloc(input_device->report_desc_size,
					  GFP_ATOMIC);

@@ -342,6 +348,8 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
	struct mousevsc_prt_msg *request;
	struct mousevsc_prt_msg *response;

	reinit_completion(&input_dev->wait_event);

	request = &input_dev->protocol_req;
	memset(request, 0, sizeof(struct mousevsc_prt_msg));

@@ -541,6 +549,30 @@ static int mousevsc_remove(struct hv_device *dev)
	return 0;
}

static int mousevsc_suspend(struct hv_device *dev)
{
	vmbus_close(dev->channel);

	return 0;
}

static int mousevsc_resume(struct hv_device *dev)
{
	int ret;

	ret = vmbus_open(dev->channel,
			 INPUTVSC_SEND_RING_BUFFER_SIZE,
			 INPUTVSC_RECV_RING_BUFFER_SIZE,
			 NULL, 0,
			 mousevsc_on_channel_callback,
			 dev);
	if (ret)
		return ret;

	ret = mousevsc_connect_to_vsp(dev);
	return ret;
}

static const struct hv_vmbus_device_id id_table[] = {
	/* Mouse guid */
	{ HV_MOUSE_GUID, },
@@ -554,6 +586,8 @@ static struct hv_driver mousevsc_drv = {
	.id_table = id_table,
	.probe = mousevsc_probe,
	.remove = mousevsc_remove,
	.suspend = mousevsc_suspend,
	.resume = mousevsc_resume,
	.driver = {
		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
	},
Loading