config: Add Hardware description object to the VM configuration#1209
config: Add Hardware description object to the VM configuration#1209kolyshkin merged 1 commit intoopencontainers:mainfrom
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.
Is “number” different from “int”?
There was a problem hiding this comment.
Thank you. Changed to int.
config-vm.md
Outdated
| ], | ||
| "iomems": [ | ||
| { | ||
| "firstMFN": 0x3000, |
There was a problem hiding this comment.
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.
| 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.
Fixed. Thanks.
specs-go/config.go
Outdated
| // 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.
| HwConfig HWConfig `json:"hwconfig"` | |
| HwConfig *HWConfig `json:"hwconfig,omitempty"` |
There was a problem hiding this comment.
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.
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?
There was a problem hiding this comment.
This configuration is applicable for xen and stores information about the devices that should be passed to xen guest. That's why I marked it as OPTIONAL. I believe that there are similar configurations in other Type-1 hypervisors but I think that each implementation has it's specific format and additional fields. Some staff like "vcpus", "memory" and so on are generic, but hardware passthrough fields are to specific to the exact implementation and even architecture. I don't see the generic way to define this fields right now.
|
What's the current status of this? |
Hi @AkihiroSuda, |
|
@opencontainers/runtime-spec-maintainers What should we do with this? Can we merge? |
|
@opencontainers/runtime-spec-maintainers Any objections here? |
|
Looking forward to get this merged. If any comments appears I'm ready to fix them |
|
@opencontainers/runtime-spec-maintainers Two LGTMs so far. Let's merge this PR by the end of the week if there is no objection. |
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: