Skip to content
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

Xen support #2

Draft
wants to merge 4 commits into
base: k3_main
Choose a base branch
from
Draft

Xen support #2

wants to merge 4 commits into from

Conversation

natto1784
Copy link

Aim

This PR aims to showcase how Xen support can be added to baremetal and FreeRTOS binaries

Changes

Xen

  • Parts taken from mini-os source tree and modified to work with this tree
  • Basic hypercall infrastructure
  • Basic output support for both Xen and Xen PV console
  • Partial event channel and HVM support, done mainly to support the above.

Build system

  • --enable-xen flag to enable Xen support in project.js
  • ENABLE_XEN variable for makefile support
  • Conditional XEN_ENABLED define in C and assembly files
  • Conditional compilation of the Xen part of code under /drivers/xen
  • Conditional address changes in the linker template for am62 a53 examples

dpl (both freertos and nortos)

  • Added the linux kernel zImage header to the binary for it to be able to be recognized by Xen
  • Print to Xen/PV console by default if Xen is enabled

Notes

  • Code style for the Xen code is still the same as mini-os source code, except a few public functions
  • No TI license headers are present in the new files yet
  • am62p does not have a53 support yet, but it can be enabled easily by following how it was enabled for am62
  • No peripherals have been tested yet, but passthroughing a UART and using that instead of the Xen/PV console should work just fine.

Potential TODOs

  • Changes to example templates
  • Add some basic examples for Xen
  • Conditionally add Xen to an existing component instead of a standalone component. This would allow us to build binaries without linking this new library.

- Add basic xen hypercall mechanism
- Add helper functions to print to xen console
- Add helper functions to print to xen PV console
- Add --xen-enable flag to the build system
- Enable Xen for AM62 and AM62P
- AM62: Edit addresses in a53 linker template for xen

Signed-off-by: Amneesh Singh <[email protected]>
- dpl/a53: add linux zImage kernel header for Xen
- dpl/common: print to Xen/PV console when Xen is enabled

Signed-off-by: Amneesh Singh <[email protected]>
- portable/portASM.s: add linux zImage kernel header for Xen
- dpl/common: print to Xen/PV console when Xen is enabled

Signed-off-by: Amneesh Singh <[email protected]>
@natto1784
Copy link
Author

natto1784 commented Sep 27, 2024

TODO: Passing the iomem region for timer6 in xen and mapping interrupt 158 works and ClockP_init() works fine after this too, however, HwiP_enable() fails, see why msr daifclr #2 fails. For now disable ClockP_init() for Xen.

- Change GIC address as the vGIC in Xen is at 0x30010000
- Remove SGI_PPI stuff as Xen does not support it

Signed-off-by: Amneesh Singh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant