Aarch64 serial fix#1233
Conversation
|
nit: We like to use the 50/72 rule for our commit messages. |
acatangiu
left a comment
There was a problem hiding this comment.
I think we should rename the legacy_device_manager to portio_device_manager so we get a clear-cut delimitation between mmio devices and portio devices, then completely remove the portio_device_manager from aarch64.
dianpopa
left a comment
There was a problem hiding this comment.
I agree with @acatangiu that
- LegacyDeviceManager should be renamed to PortIODeviceManager.
- PortIODeviceManager should be compiled out for aarch64 (as a consequence of this, you could also need to compile out some more things, like the i8042 usages). I would do a separate commit for this.
- Remove the
Optionaround theMMIODeviceManager, this will also benefit the x86_64 logic since we are always callingself.attach_virtio_devices()?;atstart_microvmno matter what.
vmm/src/lib.rs
Outdated
| // One lives in LegacyDeviceManager and the other in MMIODeviceManager | ||
| // Use the one that is actually plugged in the Guest. | ||
| #[cfg(target_arch = "aarch64")] | ||
| let serial = self |
There was a problem hiding this comment.
What I would do here for more elegance would be this:
Have a helper function (maybe self.get_stdio_serial()) that has two implementations, one for x86_64 and one for aarch64. See the example of
fn attach_legacy_devices(&mut self) -> std::result::Result<(), StartMicrovmError> {
Additionally, if you decide to use the get_device function from the MMIODeviceManager, this will become self.mmio_device_manager.get_device(DeviceType::Serial, "uart").
There was a problem hiding this comment.
* PortIODeviceManager should be compiled out for aarch64 (as a consequence of this, you could also need to compile out some more things, like the i8042 usages). I would do a separate commit for this. * Remove the `Option` around the `MMIODeviceManager`, this will also benefit the x86_64 logic since we are always calling `self.attach_virtio_devices()?;` at `start_microvm` no matter what.
I will perform the rename, but outcompiling this on aarch64 will backfire by lots of
#[cfg(target_arch = "x86_64")] in different parts of the codebase.
Also removing the Option depends on also initializing guest memory before instantiating the PortIODeviceManager generating even more code changes.
I think this should be done as a separate refactoring PR with a clear design defined and agreed by all.
0152295 to
6af6b87
Compare
3dbc9f3 to
aff5676
Compare
b7497fb to
4c41e9f
Compare
Signed-off-by: Andrei Sandu <[email protected]>
- Remove data_len from Serial device implementation - Rename LegacyDeviceManager to PortIODeviceManager Signed-off-by: Andrei Sandu <[email protected]>
Use the device tree clock node definition (apb_pclk). Signed-off-by: Andrei Sandu <[email protected]>
0a32477 to
2263509
Compare
2263509 to
72be4a0
Compare
- Implement RawIOHandler trait. - Add raw_io_handlers hashmap - Implmenet get_raw_io_device() mapping the RawIOHandler trait - Implement arch dependent get_serial_device() - x86_64 uses PortIODeviceManager - aarch uses MMIODeviceManafger - Move stdin_handle out of PortIODeviceManager. - Add unit test for get_raw_io_device(). Signed-off-by: Andrei Sandu <[email protected]>
72be4a0 to
9586cc9
Compare
Serial device was finally fully supported with firecracker on aarch64, see details here(firecracker-microvm/firecracker#1233). A set of kernel configs related with 8250 compatible serial ports should be turn on. Fixes: kata-containers#736 Signed-off-by: Penny Zheng <[email protected]> Signed-off-by: Haibo Xu <[email protected]>
Serial device was finally fully supported with firecracker on aarch64, see details here(firecracker-microvm/firecracker#1233). A set of kernel configs related with 8250 compatible serial ports should be turn on. Fixes: kata-containers#736 Signed-off-by: Penny Zheng <[email protected]> Signed-off-by: Haibo Xu <[email protected]>
ref: firecracker-microvm#1233 Signed-off-by: Ján Mochňak <[email protected]>
ref: #1233 Signed-off-by: Ján Mochňak <[email protected]>
ref: #1233 Signed-off-by: Ján Mochňak <[email protected]>
Fixes #1147, #1144
Description of changes:
Note: S3 update of kernel and rootfs images are also required. I'll update them after PR is merged.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.