Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Drivers: hv: Post messages through the confidential VMBus if available

When the confidential VMBus is available, the guest should post
messages to the paravisor.

Update hv_post_message() to post messages to the paravisor rather than
through GHCB or TD calls.

Signed-off-by: Roman Kisel <romank@linux.microsoft.com>
Reviewed-by: Tianyu Lan <tiala@microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>

authored by

Roman Kisel and committed by
Wei Liu
25059d5e 226494e5

+10 -1
+10 -1
drivers/hv/hv.c
··· 74 74 aligned_msg->payload_size = payload_size; 75 75 memcpy((void *)aligned_msg->payload, payload, payload_size); 76 76 77 - if (ms_hyperv.paravisor_present) { 77 + if (ms_hyperv.paravisor_present && !vmbus_is_confidential()) { 78 + /* 79 + * If the VMBus isn't confidential, use the CoCo-specific 80 + * mechanism to communicate with the hypervisor. 81 + */ 78 82 if (hv_isolation_type_tdx()) 79 83 status = hv_tdx_hypercall(HVCALL_POST_MESSAGE, 80 84 virt_to_phys(aligned_msg), 0); ··· 92 88 u64 control = HVCALL_POST_MESSAGE; 93 89 94 90 control |= hv_nested ? HV_HYPERCALL_NESTED : 0; 91 + /* 92 + * If there is no paravisor, this will go to the hypervisor. 93 + * In the Confidential VMBus case, there is the paravisor 94 + * to which this will trap. 95 + */ 95 96 status = hv_do_hypercall(control, aligned_msg, NULL); 96 97 } 97 98