RE: [RFC PATCH V2 09/18] x86/hyperv: set target vtl in the vmbus init message

From: Michael Kelley (LINUX)
Date: Wed Dec 14 2022 - 13:12:39 EST


From: Tianyu Lan <ltykernel@xxxxxxxxx> Sent: Friday, November 18, 2022 7:46 PM
>

Subject prefix here should be "Drivers: hv: vmbus:"

Per my comments on Patch 5, I'd suggest squashing this patch into
Patch 5. But also per my comments on Patch 5, I'm not clear on
why the current behavior of defaulting the VTL to zero needs to
be replaced by explicitly fetching and setting the VTL.

Michael

> Set target vtl (Virtual Trust Level) in the vmbus init message.
>
> Signed-off-by: Tianyu Lan <tiala@xxxxxxxxxxxxx>
> ---
> drivers/hv/connection.c | 1 +
> include/linux/hyperv.h | 4 ++--
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
> index 43141225ea15..09a1253b539a 100644
> --- a/drivers/hv/connection.c
> +++ b/drivers/hv/connection.c
> @@ -98,6 +98,7 @@ 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);
> diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
> index 3b42264333ef..2be0b5efd1ea 100644
> --- a/include/linux/hyperv.h
> +++ b/include/linux/hyperv.h
> @@ -665,8 +665,8 @@ struct vmbus_channel_initiate_contact {
> u64 interrupt_page;
> struct {
> u8 msg_sint;
> - u8 padding1[3];
> - u32 padding2;
> + u8 msg_vtl;
> + u8 reserved[6];
> };
> };
> u64 monitor_page1;
> --
> 2.25.1