Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions drivers/hv/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,7 @@ module_param(max_version, uint, S_IRUGO);
MODULE_PARM_DESC(max_version,
"Maximal VMBus protocol version which can be negotiated");

/*
* User requested connection id used to connect to the host. Useful for testing
* or when running a vmbus server on a non-standard connection id.
*/
static uint message_connection_id;

module_param(message_connection_id, uint, 0444);
MODULE_PARM_DESC(message_connection_id,
"The VMBus message connection id used to communicate with the Host");
/* Connection ID is now provided via device tree */

int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo, u32 version)
{
Expand Down Expand Up @@ -109,14 +101,14 @@ int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo, u32 version)
if (version >= VERSION_WIN10_V5) {
msg->msg_sint = VMBUS_MESSAGE_SINT;
msg->msg_vtl = ms_hyperv.vtl;
vmbus_connection.msg_conn_id = VMBUS_MESSAGE_CONNECTION_ID_4;
} else {
msg->interrupt_page = virt_to_phys(vmbus_connection.int_page);
vmbus_connection.msg_conn_id = VMBUS_MESSAGE_CONNECTION_ID;
}

if (message_connection_id > 0)
vmbus_connection.msg_conn_id = message_connection_id;
/* Set default connection ID if not provided via device tree */
if (!vmbus_connection.msg_conn_id)
vmbus_connection.msg_conn_id = (version >= VERSION_WIN10_V5) ?
VMBUS_MESSAGE_CONNECTION_ID_4 : VMBUS_MESSAGE_CONNECTION_ID;

/*
* shared_gpa_boundary is zero in non-SNP VMs, so it's safe to always
Expand Down
8 changes: 8 additions & 0 deletions drivers/hv/vmbus_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2345,12 +2345,20 @@ static int vmbus_device_add(struct platform_device *pdev)
struct of_range range;
struct of_range_parser parser;
struct device_node *np = pdev->dev.of_node;
unsigned int conn_id;
int ret;

pr_info("VMBus is present in DeviceTree\n");

vmbus_root_device = &pdev->dev;

/* Read connection ID from device tree */
ret = of_property_read_u32(np, "microsoft,message-connection-id", &conn_id);
if (!ret) {
pr_info("VMBus message connection ID: %u\n", conn_id);
vmbus_connection.msg_conn_id = conn_id;
}

ret = of_range_parser_init(&parser, np);
if (ret)
return ret;
Expand Down