(DO NOT MERGE: WILL UPSTREAM THIS CHANGE FIRST) get connection-id from device tree#79
Open
hargar19 wants to merge 1 commit intoproduct/hcl-main/6.12from
Open
(DO NOT MERGE: WILL UPSTREAM THIS CHANGE FIRST) get connection-id from device tree#79hargar19 wants to merge 1 commit intoproduct/hcl-main/6.12from
hargar19 wants to merge 1 commit intoproduct/hcl-main/6.12from
Conversation
The connection-id determines which hypervisor communication channel the guest should use to talk to the VMBus host. Signed-off-by: Hardik Garg <hargar@microsoft.com>
There was a problem hiding this comment.
Pull Request Overview
This PR updates the VMBus driver to source the connection ID from the device tree rather than using a module parameter, ensuring consistency with device configuration.
- Updated vmbus_drv.c to read the connection ID property from the device tree.
- Revised vmbus_connection handling in connection.c by removing the module parameter and adding default logic.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| drivers/hv/vmbus_drv.c | Added code to read and log the connection ID from the device tree. |
| drivers/hv/connection.c | Removed outdated module parameter and updated default connection ID assignment logic. |
Collaborator
Author
|
Work-item for this PR https://microsoft.visualstudio.com/OS/_workitems/edit/48864356/ |
chris-oo
approved these changes
May 27, 2025
romank-msft
approved these changes
Jun 28, 2025
Contributor
|
@hargar19 we should merge this. Without it, this commit microsoft/openvmm#1501 breaks guests with VMBus relay due to // If we're isolated we can't trust the host-provided cmdline
if can_trust_host {
let old_cmdline = &partition_info.cmdline;
// HACK: See if we should set the vmbus connection id via kernel
// commandline. It may already be set, and we don't want to set it again.
//
// This code will be removed when the kernel supports setting connection id
// via device tree.
if !old_cmdline.contains("hv_vmbus.message_connection_id=") {
write!(
cmdline,
"hv_vmbus.message_connection_id=0x{:x} ",
partition_info.vmbus_vtl2.connection_id
)?;
}
// Prepend the computed parameters to the original command line.
cmdline.write_str(old_cmdline)?;
}
``` in the bootshim. |
Collaborator
Author
|
@romank-msft I have sent this patch upstream https://lore.kernel.org/all/SN6PR02MB4157F2C0674B85C7206E6047D47CA@SN6PR02MB4157.namprd02.prod.outlook.com/ |
stunes-ms
added a commit
to microsoft/openvmm
that referenced
this pull request
Jul 2, 2025
Release backport of PR #1501 and PR #1627. If the debug bit is set in the VM's TDX attributes, the host can be trusted. This change gets the TD report in the boot shim and checks the debug bit. If it's set, parse the dynamic command line to allow enabling, e.g., confidential debugging. Note that microsoft/OHCL-Linux-Kernel#79 will need to be resolved before hardware debug can be disabled in the manifest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The connection-id determines which hypervisor communication channel the guest should use to talk to the VMBus host. Get this value from device tree instead of kernel boot arguments.
Below data shows already existing property under the vmbus device tree node with the compatible id "microsoft,message-connection-id":
cd /sys/firmware/devicetree/base/bus/vmbus
/sys/firmware/devicetree/base/bus/vmbus # hexdump microsoft,message-connection-i
d
0000000 8000 7400
0000004
connection-id value from dmesg logs after the code change:
0.630151] hv_vmbus: VMBus message connection ID: 8388724
The hexdump shows: 00 80 00 74
0x00800074 = 8388724 (decimal)