-
Notifications
You must be signed in to change notification settings - Fork 119
FROMLIST: media: iris: Enable Secure PAS support with IOMMU managed b… #653
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
base: tech/mm/video
Are you sure you want to change the base?
FROMLIST: media: iris: Enable Secure PAS support with IOMMU managed b… #653
Conversation
…y Linux Most Qualcomm platforms feature a inhouse hypervisor (such as Gunyah or QHEE), which typically handles IOMMU configuration. This includes mapping memory regions and device memory resources for remote processors by intercepting qcom_scm_pas_auth_and_reset() calls. These mappings are later removed during teardown. Additionally, SHM bridge setup is required to enable memory protection for both remoteproc metadata and its memory regions. When the hypervisor is absent, the operating system must perform these configurations instead. Support for handling IOMMU and SHM setup in the absence of a hypervisor is now in place. Extend the Iris driver to enable this functionality on platforms where IOMMU is managed by Linux (i.e., non-Gunyah, non-QHEE). Additionally, the Iris driver must map the firmware and its required resources to the firmware SID, which is now specified via the device tree. Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Vikash Garodia <[email protected]>
| return 0; | ||
|
|
||
| err_iommu_free: | ||
| iommu_domain_free(iommu_dom); |
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.
Drop this
| res_size = resource_size(&res); | ||
|
|
||
| if (core->has_iommu) | ||
| dev = core->fw.dev; |
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.
Why there is a need for has_iommu ?
dev = core->fw.dev ? : core->dev;
| if (ret) | ||
| goto err_mem_unmap; | ||
|
|
||
| if (core->has_iommu) { |
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.
if (core->fw.iommu_domain) ?
|
|
||
| ctx = core->fw.ctx; | ||
| ret = qcom_scm_pas_shutdown(ctx->pas_id); | ||
| if (core->has_iommu) { |
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.
same here
| if (!np) | ||
| return 0; | ||
|
|
||
| core->has_iommu = true; |
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.
drop this additional
|
|
||
| void iris_fw_deinit(struct iris_core *core) | ||
| { | ||
| if (!core->has_iommu) |
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.
..something like if (!fw dev) return 0;
vgarodia
left a comment
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.
Comments
Most Qualcomm platforms feature a inhouse hypervisor (such as Gunyah or QHEE), which typically handles IOMMU configuration. This includes mapping memory regions and device memory resources for remote processors by intercepting qcom_scm_pas_auth_and_reset() calls. These mappings are later removed during teardown. Additionally, SHM bridge setup is required to enable memory protection for both remoteproc metadata and its memory regions.
When the hypervisor is absent, the operating system must perform these configurations instead.
Support for handling IOMMU and SHM setup in the absence of a hypervisor is now in place. Extend the Iris driver to enable this functionality on platforms where IOMMU is managed by Linux (i.e., non-Gunyah, non-QHEE).
Additionally, the Iris driver must map the firmware and its required resources to the firmware SID, which is now specified via the device tree.
Link: https://lore.kernel.org/lkml/[email protected]/
Exception JIRA: https://jira-dc.qualcomm.com/jira/browse/QLIJIRA-109