[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250828010557.123869-8-romank@linux.microsoft.com>
Date: Wed, 27 Aug 2025 18:05:48 -0700
From: Roman Kisel <romank@...ux.microsoft.com>
To: arnd@...db.de,
bp@...en8.de,
corbet@....net,
dave.hansen@...ux.intel.com,
decui@...rosoft.com,
haiyangz@...rosoft.com,
hpa@...or.com,
kys@...rosoft.com,
mikelley@...rosoft.com,
mingo@...hat.com,
tglx@...utronix.de,
Tianyu.Lan@...rosoft.com,
wei.liu@...nel.org,
x86@...nel.org,
linux-hyperv@...r.kernel.org,
linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-arch@...r.kernel.org
Cc: benhill@...rosoft.com,
bperkins@...rosoft.com,
sunilmut@...rosoft.com,
romank@...ux.microsoft.com
Subject: [PATCH hyperv-next v5 07/16] 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@...ux.microsoft.com>
Reviewed-by: Tianyu Lan <tiala@...rosoft.com>
Reviewed-by: Michael Kelley <mhklinux@...look.com>
---
drivers/hv/hv.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index fe97591bc44d..951330ca4ba9 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -76,7 +76,11 @@ int hv_post_message(union hv_connection_id connection_id,
aligned_msg->payload_size = payload_size;
memcpy((void *)aligned_msg->payload, payload, payload_size);
- if (ms_hyperv.paravisor_present) {
+ if (ms_hyperv.paravisor_present && !vmbus_is_confidential()) {
+ /*
+ * If the VMBus isn't confidential, use the CoCo-specific
+ * mechanism to communicate with the hypervisor.
+ */
if (hv_isolation_type_tdx())
status = hv_tdx_hypercall(HVCALL_POST_MESSAGE,
virt_to_phys(aligned_msg), 0);
@@ -90,6 +94,11 @@ int hv_post_message(union hv_connection_id connection_id,
u64 control = HVCALL_POST_MESSAGE;
control |= hv_nested ? HV_HYPERCALL_NESTED : 0;
+ /*
+ * If there is no paravisor, this will go to the hypervisor.
+ * In the Confidential VMBus case, there is the paravisor
+ * to which this will trap.
+ */
status = hv_do_hypercall(control, aligned_msg, NULL);
}
--
2.43.0
Powered by blists - more mailing lists