arm64/hyperv: Add Device Tree Support#139
Merged
Merged
Conversation
Add support for Device Tree (DT) configurations within the arm64 Hyper-V environment, enabling boot with DeviceTree, too, rather than with ACPI or SMCCC only. Signed-off-by: Roman Kisel <romank@microsoft.com> Signed-off-by: Hardik Garg <hargar@microsoft.com>
d5a412e to
377a1f3
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a Device Tree (DT) based detection path for running under Hyper-V on arm64, so the Hyper-V guest initialization can proceed when booted via DT in addition to existing ACPI and SMCCC-based detection.
Changes:
- Add DT/FDT-related includes and a new
hyperv_detect_via_fdt()helper. - Extend
hyperv_init()detection logic to initialize Hyper-V when DT indicatesmicrosoft,hyperv.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+76
to
+87
| static bool __init hyperv_detect_via_fdt(void) | ||
| { | ||
| #if IS_ENABLED(CONFIG_OF) | ||
| const unsigned long hyp_node = of_get_flat_dt_subnode_by_name( | ||
| of_get_flat_dt_root(), "hypervisor"); | ||
|
|
||
| return (hyp_node != -FDT_ERR_NOTFOUND) && | ||
| of_flat_dt_is_compatible(hyp_node, "microsoft,hyperv"); | ||
| #else | ||
| return false; | ||
| #endif | ||
| } |
Comment on lines
+18
to
+20
| #include <linux/libfdt.h> | ||
| #include <linux/of.h> | ||
| #include <linux/of_fdt.h> |
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.
Add support for Device Tree (DT) configurations within the
arm64 Hyper-V environment, enabling boot with DeviceTree, too,
rather than with ACPI or SMCCC only.
Signed-off-by: Hardik Garg hargar@microsoft.com