-
Notifications
You must be signed in to change notification settings - Fork 161
feat(slave side prot): Add support for slave side mmio protection #260
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: main
Are you sure you want to change the base?
Conversation
c16ef38 to
3adf6ca
Compare
ad97547 to
787ac35
Compare
e99f0a2 to
65194e1
Compare
787ac35 to
9869e87
Compare
a2a4944 to
e239802
Compare
|
@miguelafsilva5 please resolve conflicts |
7849408 to
b0a283a
Compare
|
@miguelafsilva5 please resolve conflicts again. Ping me as soon as it is done so it doesn't happen again with other PRs accepted to main. |
b0a283a to
4c261de
Compare
The mmio regions present in the platform description are to be mapped accessible for all address spaces. Signed-off-by: Miguel Silva <miguelafsilva5@gmail.com>
Each architecture needs to implement their access control function. This function is called during the dev init for vms, and is executed instead of the original memory mapping. Signed-off-by: Miguel Silva <miguelafsilva5@gmail.com>
Signed-off-by: Miguel Silva <miguelafsilva5@gmail.com>
4c261de to
c2b9eff
Compare
@josecm should be fixed |
|
@danielRep @DavidMCerdeira please review this PR |
|
|
||
| ifeq ($(mmio_slave_side_prot),y) | ||
| build_macros+=-DMMIO_SLAVE_SIDE_PROT | ||
|
|
||
| ifneq ($(arch_mem_prot),mpu) | ||
| $(error mmio_slave_side_prot=y requires arch_mem_prot=mpu) | ||
| endif |
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.
deleted by mistake?
ifeq ($(phys_irqs_only),y)
build_macros+=-DPHYS_IRQS_ONLY
|
|
||
| cpu_sync_init(&vm->sync, vm->cpu_num); | ||
|
|
||
| vm_mem_prot_init(vm, vm_config); |
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.
Also deleted by mistake? Why are we removing this?
PR description
This PR introduces support for slave-side MMIO protection. This is needed on MCU platforms that otherwise would require each device to be mapped in the MPU. With this PR, the entire MMIO region(s) is mapped on the MPU and each architecture/platform needs to implement a functions that enables and controls the access to each device. This function is called during vm device initialization.
It is important to note that, when installing an emul handler for a device inside the mmio region, if slave side mmio protection is enabled, we have to unmap the device memory range.
This PR was only tested for TC4, as it is the current platform that needs this feature. Before accepting the PR we have to make sure all other platforms are running as expected.