Skip to content

Commit b9a2abc

Browse files
authored
ohcl_boot: Always set the vmbus connection id, even when isolated (#1878)
This fixes VMBus Relay on TDX without the hw debug bit.
1 parent fdba810 commit b9a2abc

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

openhcl/openhcl_boot/src/main.rs

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -273,25 +273,20 @@ fn build_kernel_command_line(
273273
write!(cmdline, "{} ", sidecar.kernel_command_line())?;
274274
}
275275

276+
// HACK: Set the vmbus connection id via kernel commandline.
277+
//
278+
// This code will be removed when the kernel supports setting connection id
279+
// via device tree.
280+
write!(
281+
cmdline,
282+
"hv_vmbus.message_connection_id=0x{:x} ",
283+
partition_info.vmbus_vtl2.connection_id
284+
)?;
285+
276286
// If we're isolated we can't trust the host-provided cmdline
277287
if can_trust_host {
278-
let old_cmdline = &partition_info.cmdline;
279-
280-
// HACK: See if we should set the vmbus connection id via kernel
281-
// commandline. It may already be set, and we don't want to set it again.
282-
//
283-
// This code will be removed when the kernel supports setting connection id
284-
// via device tree.
285-
if !old_cmdline.contains("hv_vmbus.message_connection_id=") {
286-
write!(
287-
cmdline,
288-
"hv_vmbus.message_connection_id=0x{:x} ",
289-
partition_info.vmbus_vtl2.connection_id
290-
)?;
291-
}
292-
293288
// Prepend the computed parameters to the original command line.
294-
cmdline.write_str(old_cmdline)?;
289+
cmdline.write_str(&partition_info.cmdline)?;
295290
}
296291

297292
Ok(())

0 commit comments

Comments
 (0)