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

xenvm: drivers: xen: add new Xen-related features (event channels, irq console and consoleio Dom0 console) #39960

Merged
merged 4 commits into from
Dec 7, 2021

Conversation

firscity
Copy link
Contributor

@firscity firscity commented Nov 1, 2021

This pull-request introduces new features, related to Xen virtualization support.

It includes:

  1. Xen enlighten driver. This driver allows usage of pre-defined Xen event-channels (XenBus, PV console) on single (boot) CPU, allocation and other VCPU registration (VCPUOP_register_vcpu_info) will be added in future versions.
  2. Interrupt-driven API for Xen PV console over event channels.
  3. Consoleio driver for Zephyr as Dom0 (privileged) domain (only for Dom0 console input/output work in regular Xen build, for debug build output works for other domain - already implemented in uart-xen-hvc).

Also XenVM doc was updated according to new changes.

@github-actions github-actions bot added area: API Changes to public APIs area: ARM64 ARM (64-bit) Architecture area: Boards area: Documentation labels Nov 1, 2021
@firscity firscity marked this pull request as draft November 1, 2021 13:18
@firscity firscity force-pushed the xen_irq_console_pr branch 2 times, most recently from bf8b4e1 to 32dc576 Compare November 1, 2021 18:39
@firscity firscity marked this pull request as ready for review November 2, 2021 08:23
@zephyrbot zephyrbot added area: ARM ARM (32-bit) Architecture area: Build System area: UART Universal Asynchronous Receiver-Transmitter labels Nov 2, 2021
drivers/xen/events.c Outdated Show resolved Hide resolved
@povergoing
Copy link
Member

Just out of curiosity, how to create a DomU when Zephyr acts as Dom0? Would you like to describe the instructions in the documents?

@firscity
Copy link
Contributor Author

firscity commented Nov 5, 2021

Just out of curiosity, how to create a DomU when Zephyr acts as Dom0?

This is huge feature I am currently working on, but it stills in progress. So it is not ready to any kind of instructions or docs, sorry.
During development I just trying to upstream some helpful things to Zephyr mainline, Dom0 console is one of them.

@dcpleung
Copy link
Member

dcpleung commented Nov 5, 2021

Recommend changing to hvc_xen_consoleio for filenames, so that it will be next to uart_hvc_xen.c in directory listing. Same goes for kconfig by moving CONSOLEIO to the end.

@firscity
Copy link
Contributor Author

firscity commented Nov 8, 2021

Recommend changing to hvc_xen_consoleio for filenames, so that it will be next to uart_hvc_xen.c in directory listing. Same goes for kconfig by moving CONSOLEIO to the end.

Thank you for great suggestion! Done.

CODEOWNERS Outdated Show resolved Hide resolved
@firscity
Copy link
Contributor Author

Dear @carlocaione, can you please take a look on this PR?

Copy link
Collaborator

@carlocaione carlocaione left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ok but you need to fix the conflicting file issue.

This commit adds support of Xen Enlighten page and initial support for
Xen event channels. It is needed for future Xen PV drivers
implementation.

Now enlighten page is mapped to the prepared memory area on
PRE_KERNEL_1 stage. In case of success event channel logic gets
inited and can be used ASAP after Zephyr start. Current implementation
allows to use only pre-defined event channels (PV console/XenBus) and
works only in single CPU mode (without VCPUOP_register_vcpu_info).
Event channel allocation will be implemented in future versions.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
This commit adds support of interrupt-driven API for UART-like Xen PV
console driver. It is implemented via Xen event channels. It allows to
send and receive data by chunks (not single symbols) and without
polling.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
This commit adds Xen consoleio serial driver. It is needed to receive
kernel messages from Zephyr in case it runs as Xen privileged domain
(Dom0). There is no console ring buffer for such domain, so regular
uart_hvc_xen driver can not be used (privileged domain input/output
are possible only through consoleio interface).

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
This commit updates list of supported Xen VM fetures after
implementation of Xen Enlighten, event channels and interrupt-driven
UART API for Xen hypervisor console driver.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
@firscity
Copy link
Contributor Author

Looks like some CI tests were stuck. I decided to re-pushed commits, no changes were made by last force-push.

@firscity
Copy link
Contributor Author

The only one test that failing is:

-:640: WARNING:NEW_TYPEDEFS: do not add new typedefs
#640: FILE: include/xen/events.h:20:
+typedef struct event_channel_handle evtchn_handle_t;

- total: 0 errors, 1 warnings, 582 lines checked

I think it is okay and PR can be merged.

@carlocaione
Copy link
Collaborator

@nashif we need your superpower here

@firscity
Copy link
Contributor Author

firscity commented Dec 1, 2021

Dear @nashif, can you please process this?

@klogg
Copy link

klogg commented Dec 7, 2021

Hi @carlocaione @nashif, are there any issues with this PR that block it from merging?

@nashif nashif merged commit ce6d402 into zephyrproject-rtos:main Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: ARM ARM (32-bit) Architecture area: ARM64 ARM (64-bit) Architecture area: Boards area: Build System area: Documentation area: UART Universal Asynchronous Receiver-Transmitter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants