-
Notifications
You must be signed in to change notification settings - Fork 551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config: Add Hardware description object to the VM configuration #1209
base: main
Are you sure you want to change the base?
Conversation
@slp could this be useful for krun? |
@giuseppe I don't see an immediate use for it, but it's good to know it's there. |
config-vm.md
Outdated
* **`memKB`** (int OPTIONAL) Maximum memory in KB allocated to the VM. | ||
* **`dtdevs`** (array OPTIONAL) Host device tree nodes to passthrough to the VM, see [Xen Config][xl-config-format] for the details. | ||
* **`iomems`** (array OPTIONAL) Allow auto-translated domains to access specific hardware I/O memory pages, see [Xen Config][xl-config-format]. | ||
* **`firstGFN`** (number OPTIONAL) Guest Frame Number to map the iomem range. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is “number” different from “int”?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Changed to int.
config-vm.md
Outdated
], | ||
"iomems": [ | ||
{ | ||
"firstMFN": 0x3000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON does not allow hex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip. Changed it to the number sequence, supported by JSON format.
specs-go/config.go
Outdated
// IOMems containes information about iomem addresses that should be passed to the VM. | ||
type IOMems struct { | ||
// Guest Frame Number to map the iomem range. If GFN is not specified, the mapping will be done to the same Frame Number as was provided in FirstMFN. | ||
FirstGFN uint64 `json:"firstGFN"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FirstGFN uint64 `json:"firstGFN"` | |
FirstGFN *uint64 `json:"firstGFN,omitempty"` |
to distinguish nil (unset) from zero.
Same for other properties too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks.
specs-go/config.go
Outdated
@@ -657,6 +683,8 @@ type VM struct { | |||
Kernel VMKernel `json:"kernel"` | |||
// Image specifies guest image related configuration for virtual-machine-based containers. | |||
Image VMImage `json:"image,omitempty"` | |||
// Hardware configuration that should be passed to the VM. | |||
HwConfig HWConfig `json:"hwconfig"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HwConfig HWConfig `json:"hwconfig"` | |
HwConfig *HWConfig `json:"hwconfig,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks.
f07267b
to
29a362b
Compare
Looks good, but we are freezing the main branch until releasing v1.1.0. Hope we can release v1.1.0 and merge post-v1.1 PRs in the next couple of weeks. |
This adds section to describe HW that should be passed through to the VM. This enables Hardware-level isolation provided by XEN for e.g. functional safety use cases. Adds hwConfig object to the VM section which is apt to describe the initial configuration for the VM, sush as number of vcpus and memory, provided to the VM. Hardware description includes path to the device-tree, that should be passed to the VM and the hardware configuration parameters which provides all needed data for VM to use the devices, such as: - dtdevs: host device tree nodes to passthrough to the VM; - iomems: allow auto-translated domains to access specific hardware I/O memory pages; - irqs: allows VM to access specific physical IRQs. Signed-off-by: Oleksii Moisieiev <[email protected]>
29a362b
to
af0d16d
Compare
We plan to extend with RT scheduling / mem bw control for domains, do you have some interest or ideas in that? |
Hi @AkihiroSuda. Do you have any plans merging this changes? |
Yes, but after releasing this: We also want to see a POC of this PR to confirm implementability. |
Thank you for the quick response. What do you expect as POC? Some real yamls based on this bindings? |
A POC of an actual runtime implementation would be more preferable |
ping @opencontainers/runtime-spec-maintainers |
Hi @AkihiroSuda, |
* **`deviceTree`** (string OPTIONAL) Path to the container device-tree file that should be passed to the VM. | ||
* **`vcpus`** (int OPTIONAL) Number of virtual cpus for the VM. | ||
* **`memory`** (int OPTIONAL) Maximum memory in bytes allocated to the VM. | ||
* **`dtdevs`** (array OPTIONAL) Host device tree nodes to passthrough to the VM, see [Xen Config][xl-config-format] for the details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's several references here to Xen specifically -- are these all applicable to other implementations too, or are these mostly Xen-specific fields?
I'm trying to understand how this helps improve interoperability between runtimes, so another way to put this question is whether you envision more than one runtime will implement support for this?
This adds section to describe HW that should be passed through to the VM. This enables Hardware-level isolation provided by XEN for e.g. functional safety use cases.
Adds hwConfig object to the VM section which is apt to describe the initial configuration for the VM, sush as number of vcpus and memory, provided to the VM.
Hardware description includes path to the device-tree, that should be passed to the VM and the hardware configuration parameters which provides all needed data for VM to use the devices, such as: