Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * An implementation of host initiated guest snapshot.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright (C) 2013, Microsoft, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Author : K. Y. Srinivasan <kys@microsoft.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/net.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/nls.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/connector.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/workqueue.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/hyperv.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <asm/hyperv-tlfs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include "hyperv_vmbus.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include "hv_utils_transport.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #define VSS_MAJOR  5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #define VSS_MINOR  0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #define VSS_VERSION    (VSS_MAJOR << 16 | VSS_MINOR)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #define VSS_VER_COUNT 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) static const int vss_versions[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	VSS_VERSION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #define FW_VER_COUNT 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) static const int fw_versions[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	UTIL_FW_VERSION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  * Timeout values are based on expecations from host
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) #define VSS_FREEZE_TIMEOUT (15 * 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)  * Global state maintained for transaction that is being processed. For a class
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)  * of integration services, including the "VSS service", the specified protocol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  * is a "request/response" protocol which means that there can only be single
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  * outstanding transaction from the host at any given point in time. We use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)  * this to simplify memory management in this driver - we cache and process
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  * only one message at a time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47)  * While the request/response protocol is guaranteed by the host, we further
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48)  * ensure this by serializing packet processing in this driver - we do not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49)  * read additional packets from the VMBUs until the current packet is fully
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50)  * handled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) static struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	int state;   /* hvutil_device_state */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	int recv_len; /* number of bytes received. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	struct vmbus_channel *recv_channel; /* chn we got the request */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	u64 recv_req_id; /* request ID. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	struct hv_vss_msg  *msg; /* current message */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) } vss_transaction;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) static void vss_respond_to_host(int error);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65)  * This state maintains the version number registered by the daemon.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) static int dm_reg_value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) static const char vss_devname[] = "vmbus/hv_vss";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) static __u8 *recv_buffer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) static struct hvutil_transport *hvt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) static void vss_timeout_func(struct work_struct *dummy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) static void vss_handle_request(struct work_struct *dummy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) static DECLARE_DELAYED_WORK(vss_timeout_work, vss_timeout_func);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) static DECLARE_WORK(vss_handle_request_work, vss_handle_request);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) static void vss_poll_wrapper(void *channel)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	/* Transaction is finished, reset the state here to avoid races. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	vss_transaction.state = HVUTIL_READY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	tasklet_schedule(&((struct vmbus_channel *)channel)->callback_event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87)  * Callback when data is received from user mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) static void vss_timeout_func(struct work_struct *dummy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	 * Timeout waiting for userspace component to reply happened.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	pr_warn("VSS: timeout waiting for daemon to reply\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	vss_respond_to_host(HV_E_FAIL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	hv_poll_channel(vss_transaction.recv_channel, vss_poll_wrapper);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) static void vss_register_done(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	hv_poll_channel(vss_transaction.recv_channel, vss_poll_wrapper);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	pr_debug("VSS: userspace daemon registered\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) static int vss_handle_handshake(struct hv_vss_msg *vss_msg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	u32 our_ver = VSS_OP_REGISTER1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	switch (vss_msg->vss_hdr.operation) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	case VSS_OP_REGISTER:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		/* Daemon doesn't expect us to reply */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 		dm_reg_value = VSS_OP_REGISTER;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	case VSS_OP_REGISTER1:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 		/* Daemon expects us to reply with our own version */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		if (hvutil_transport_send(hvt, &our_ver, sizeof(our_ver),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 					  vss_register_done))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 			return -EFAULT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		dm_reg_value = VSS_OP_REGISTER1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	pr_info("VSS: userspace daemon ver. %d connected\n", dm_reg_value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) static int vss_on_msg(void *msg, int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	struct hv_vss_msg *vss_msg = (struct hv_vss_msg *)msg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	if (len != sizeof(*vss_msg)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 		pr_debug("VSS: Message size does not match length\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	if (vss_msg->vss_hdr.operation == VSS_OP_REGISTER ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	    vss_msg->vss_hdr.operation == VSS_OP_REGISTER1) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 		/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 		 * Don't process registration messages if we're in the middle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		 * of a transaction processing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		if (vss_transaction.state > HVUTIL_READY) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 			pr_debug("VSS: Got unexpected registration request\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 			return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		return vss_handle_handshake(vss_msg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	} else if (vss_transaction.state == HVUTIL_USERSPACE_REQ) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		vss_transaction.state = HVUTIL_USERSPACE_RECV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 		if (vss_msg->vss_hdr.operation == VSS_OP_HOT_BACKUP)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 			vss_transaction.msg->vss_cf.flags =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 				VSS_HBU_NO_AUTO_RECOVERY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 		if (cancel_delayed_work_sync(&vss_timeout_work)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 			vss_respond_to_host(vss_msg->error);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 			/* Transaction is finished, reset the state. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 			hv_poll_channel(vss_transaction.recv_channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 					vss_poll_wrapper);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		/* This is a spurious call! */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 		pr_debug("VSS: Transaction not active\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) static void vss_send_op(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	int op = vss_transaction.msg->vss_hdr.operation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	int rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	struct hv_vss_msg *vss_msg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	/* The transaction state is wrong. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	if (vss_transaction.state != HVUTIL_HOSTMSG_RECEIVED) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		pr_debug("VSS: Unexpected attempt to send to daemon\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	vss_msg = kzalloc(sizeof(*vss_msg), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	if (!vss_msg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	vss_msg->vss_hdr.operation = op;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	vss_transaction.state = HVUTIL_USERSPACE_REQ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	schedule_delayed_work(&vss_timeout_work, op == VSS_OP_FREEZE ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 			VSS_FREEZE_TIMEOUT * HZ : HV_UTIL_TIMEOUT * HZ);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	rc = hvutil_transport_send(hvt, vss_msg, sizeof(*vss_msg), NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	if (rc) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 		pr_warn("VSS: failed to communicate to the daemon: %d\n", rc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 		if (cancel_delayed_work_sync(&vss_timeout_work)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 			vss_respond_to_host(HV_E_FAIL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 			vss_transaction.state = HVUTIL_READY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	kfree(vss_msg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) static void vss_handle_request(struct work_struct *dummy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	switch (vss_transaction.msg->vss_hdr.operation) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	 * Initiate a "freeze/thaw" operation in the guest.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	 * We respond to the host once the operation is complete.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	 * We send the message to the user space daemon and the operation is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	 * performed in the daemon.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	case VSS_OP_THAW:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	case VSS_OP_FREEZE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	case VSS_OP_HOT_BACKUP:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 		if (vss_transaction.state < HVUTIL_READY) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 			/* Userspace is not registered yet */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 			pr_debug("VSS: Not ready for request.\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 			vss_respond_to_host(HV_E_FAIL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 			return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 		pr_debug("VSS: Received request for op code: %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 			vss_transaction.msg->vss_hdr.operation);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 		vss_transaction.state = HVUTIL_HOSTMSG_RECEIVED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 		vss_send_op();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	case VSS_OP_GET_DM_INFO:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 		vss_transaction.msg->dm_info.flags = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	vss_respond_to_host(0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	hv_poll_channel(vss_transaction.recv_channel, vss_poll_wrapper);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)  * Send a response back to the host.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) static void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) vss_respond_to_host(int error)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	struct icmsg_hdr *icmsghdrp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 	u32	buf_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 	struct vmbus_channel *channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 	u64	req_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	 * Copy the global state for completing the transaction. Note that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	 * only one transaction can be active at a time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 	buf_len = vss_transaction.recv_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	channel = vss_transaction.recv_channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 	req_id = vss_transaction.recv_req_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 	icmsghdrp = (struct icmsg_hdr *)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 			&recv_buffer[sizeof(struct vmbuspipe_hdr)];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 	if (channel->onchannel_callback == NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 		/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 		 * We have raced with util driver being unloaded;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 		 * silently return.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 	icmsghdrp->status = error;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 	icmsghdrp->icflags = ICMSGHDRFLAG_TRANSACTION | ICMSGHDRFLAG_RESPONSE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 	vmbus_sendpacket(channel, recv_buffer, buf_len, req_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 				VM_PKT_DATA_INBAND, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284)  * This callback is invoked when we get a VSS message from the host.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285)  * The host ensures that only one VSS transaction can be active at a time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) void hv_vss_onchannelcallback(void *context)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 	struct vmbus_channel *channel = context;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 	u32 recvlen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 	u64 requestid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 	struct hv_vss_msg *vss_msg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 	int vss_srv_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 	struct icmsg_hdr *icmsghdrp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 	if (vss_transaction.state > HVUTIL_READY)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 	vmbus_recvpacket(channel, recv_buffer, HV_HYP_PAGE_SIZE * 2, &recvlen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 			 &requestid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 	if (recvlen > 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 		icmsghdrp = (struct icmsg_hdr *)&recv_buffer[
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 			sizeof(struct vmbuspipe_hdr)];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 		if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 			if (vmbus_prep_negotiate_resp(icmsghdrp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 				 recv_buffer, fw_versions, FW_VER_COUNT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 				 vss_versions, VSS_VER_COUNT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 				 NULL, &vss_srv_version)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 				pr_info("VSS IC version %d.%d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 					vss_srv_version >> 16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 					vss_srv_version & 0xFFFF);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 		} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 			vss_msg = (struct hv_vss_msg *)&recv_buffer[
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 				sizeof(struct vmbuspipe_hdr) +
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 				sizeof(struct icmsg_hdr)];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 			/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 			 * Stash away this global state for completing the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 			 * transaction; note transactions are serialized.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 			vss_transaction.recv_len = recvlen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 			vss_transaction.recv_req_id = requestid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 			vss_transaction.msg = (struct hv_vss_msg *)vss_msg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 			schedule_work(&vss_handle_request_work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 			return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 		icmsghdrp->icflags = ICMSGHDRFLAG_TRANSACTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 			| ICMSGHDRFLAG_RESPONSE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 		vmbus_sendpacket(channel, recv_buffer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 				       recvlen, requestid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 				       VM_PKT_DATA_INBAND, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) static void vss_on_reset(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 	if (cancel_delayed_work_sync(&vss_timeout_work))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 		vss_respond_to_host(HV_E_FAIL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 	vss_transaction.state = HVUTIL_DEVICE_INIT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) hv_vss_init(struct hv_util_service *srv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 	if (vmbus_proto_version < VERSION_WIN8_1) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 		pr_warn("Integration service 'Backup (volume snapshot)'"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 			" not supported on this host version.\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 		return -ENOTSUPP;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 	recv_buffer = srv->recv_buffer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 	vss_transaction.recv_channel = srv->channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 	 * When this driver loads, the user level daemon that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 	 * processes the host requests may not yet be running.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 	 * Defer processing channel callbacks until the daemon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 	 * has registered.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 	vss_transaction.state = HVUTIL_DEVICE_INIT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 	hvt = hvutil_transport_init(vss_devname, CN_VSS_IDX, CN_VSS_VAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 				    vss_on_msg, vss_on_reset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 	if (!hvt) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 		pr_warn("VSS: Failed to initialize transport\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 		return -EFAULT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) static void hv_vss_cancel_work(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 	cancel_delayed_work_sync(&vss_timeout_work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 	cancel_work_sync(&vss_handle_request_work);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) int hv_vss_pre_suspend(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 	struct vmbus_channel *channel = vss_transaction.recv_channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 	struct hv_vss_msg *vss_msg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 	 * Fake a THAW message for the user space daemon in case the daemon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 	 * has frozen the file systems. It doesn't matter if there is already
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 	 * a message pending to be delivered to the user space since we force
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 	 * vss_transaction.state to be HVUTIL_READY, so the user space daemon's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 	 * write() will fail with EINVAL (see vss_on_msg()), and the daemon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 	 * will reset the device by closing and re-opening it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 	vss_msg = kzalloc(sizeof(*vss_msg), GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 	if (!vss_msg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 	tasklet_disable(&channel->callback_event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) 	vss_msg->vss_hdr.operation = VSS_OP_THAW;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 	/* Cancel any possible pending work. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 	hv_vss_cancel_work();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 	/* We don't care about the return value. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 	hvutil_transport_send(hvt, vss_msg, sizeof(*vss_msg), NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 	kfree(vss_msg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 	vss_transaction.state = HVUTIL_READY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 	/* tasklet_enable() will be called in hv_vss_pre_resume(). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) int hv_vss_pre_resume(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 	struct vmbus_channel *channel = vss_transaction.recv_channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 	tasklet_enable(&channel->callback_event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) void hv_vss_deinit(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 	vss_transaction.state = HVUTIL_DEVICE_DYING;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 	hv_vss_cancel_work();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 	hvutil_transport_destroy(hvt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) }