Switching from user to supervisor mode

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Switching from user to supervisor mode

754 次查看
Fatma1234
Contributor I

Hello,

I am working with uC S32K144. I am developing two applications that have different access rights, one runs under supervisor mode, the other under user mode for safety reason.

The problem is, the application that runs under user mode has sometimes the need to read some registers and maube write on them, so it gets rejected and SW resets.

For now I developed a patch to switch to the supervisor mode before running the function that access crticial registers. 

Is there another solution for that ? Is there a way to allow limited access for some registers when we are on user mode ? 

0 项奖励
回复
2 回复数

721 次查看
jane3144fitzgibbon
Contributor I

when implementing safety-critical applications that need strict separation between user mode and supervisor mode. You've made a smart decision by switching to supervisor mode to access critical registers, but it would be great to explore other ways to handle this situation more efficiently while maintaining the security and integrity of your system.

One potential solution could be leveraging a memory protection unit (MPU) or a hardware-based access control mechanism, depending on the specific capabilities of the S32K144. Some microcontrollers support configurable regions where certain registers or memory blocks can be accessed in user mode under specific conditions, without needing to fully switch to supervisor mode. This could be done by defining access rules for specific registers or memory regions. Another approach is using safe wrappers or gateways for register access, where the user mode application would call predefined functions that perform the access checks and only allow register access when it is deemed safe. These functions could then manage the transition to supervisor mode only when absolutely necessary, rather than switching modes manually within critical sections of the application.

It’s also worth checking whether the S32K144 offers features like secure supervisor mode or privileged access registers which could allow more fine-grained control over what the user mode application can access. Using these hardware security features could help you limit the scope of what is accessible without compromising the safety requirements of your system.

0 项奖励
回复

736 次查看
petervlna
NXP TechSupport
NXP TechSupport

Hello,

Please have a look at the reference manual where it is expressed and details are in safety manual:

petervlna_0-1732254357847.png

petervlna_1-1732254364585.png

 

and reference manual:

petervlna_3-1732254395202.png

For example MCM registers:

petervlna_5-1732254489189.png

 

Best regards,

Peter

0 项奖励
回复