-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fixes for Xen grant table driver #128
Fixes for Xen grant table driver #128
Conversation
@@ -382,13 +380,6 @@ static int gnttab_init(void) | |||
__ASSERT(!rc, "add_to_physmap failed; status = %d\n", rc); |
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.
This question is not related to these changes, but AFAIU this assert will work only in test builds: https://elixir.bootlin.com/zephyr/v4.0.0/source/subsys/debug/Kconfig#L249.
Is this expected, or should we use something else for assertions in any case?
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.
IIUC the purpose of asserts is Zephyr - it is expected to appear as critical error on test builds and completely disappear on target builds. Since we depend on hypervisor here, just if()
will be more correct, assert is legacy taken from mini-os driver.
Good job! |
Initially this driver was a port from mini-os. Michal Orzel (@orzelmichal) pointed that it contains incorrect grant table initialization sequence and redundant calls. Driver mapped grant table frames via loop of XENMEM_add_to_physmap calls and then tried to do the same but via GNTTABOP_setup_table operation. After completion of latter it did not even use provided frames list. This did not cause any major issues, since XENMEM_add_to_physmap correctly map gnttab frames that were used. Remove redundant GNTTABOP_setup_table call from grant table driver to clean up its initialization sequence. Signed-off-by: Dmytro Firsov <[email protected]> Acked-by: Leonid Komarianskyi <[email protected]>
Previously driver gnttab_unmap_refs() signature used incorrect struct - the same one, that is used for mapping. Since host_addr field, that is used to point to required frame is first in both structures it somehow worked. Fix mistake and use 'struct gnttab_unmap_grant_ref' for grant frames unmapping hypercalls. Signed-off-by: Dmytro Firsov <[email protected]> Acked-by: Leonid Komarianskyi <[email protected]>
934487c
to
d74eb31
Compare
@LKomaryanskiy thanks for review, added AB |
Commits in this PR fixes 2 issues in Xen grant table driver for Zephyr RTOS:
These changes will be also upstreamed to Zephyr RTOS main branch