-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Arch arm mpu move internal api #16136
Arch arm mpu move internal api #16136
Conversation
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.
@ioannisg looks okay
7beee9b
to
f8782da
Compare
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.
Changes looks fine, but curious about why arm_core_mpu_disable has to get exported and what actually the test case is doing in disable_mmu_mpu().
Feels odd to me that we are "Testing" something that doesnt have an exposed API.
@@ -23,7 +23,7 @@ | |||
#endif | |||
|
|||
#if defined(CONFIG_ARM) | |||
#include <arch/arm/cortex_m/mpu/arm_core_mpu_dev.h> | |||
extern void arm_core_mpu_disable(void); |
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.
So this made me look at the actual test, why do we have a disable_mmu_mpu() if we don't have an exposed API related to it?
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.
@andrewboie FYI
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.
@galak I get the feeling that this test is there to show that we can't disable the MPU from user mode, right @andrewboie ?
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.
I wouldn't object if we deleted that test. There's some other dubious cases in there as well.
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.
I like that it "tests" that user-mode can't play with the mpu :)
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.
Are we trying to prove whether the CPU works or the software?
Proving that the CPU works is a waste of time IMO
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.
Yeap, that's in fact, correct. So do you confirm that this test was all about verifying hardware, in the first place? If so, I'll just add a commit, to delete it :)
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.
Can we remove arm_core_mpu_disable() from arm_core_mpu_dev.h since its effectively static and the only non-static use is the explicit extern in the testcase.
Hm, I think yes - we used to invoke the enable/disable functions in arm_core_mpu.c, but perhaps not anymore. Will add a commit that does it. |
Done now, thanks. |
LGTM, will wait to see if any discussion from @andrewboie on what the test is trying to do. |
arm_core_mpu_dev.h is an internal API, and is not supposed to be directly called by kernel / application functions, therefore, we can move it inside arch/arm/core/cortex_m/mpu directory. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
In the wake of moving the internal API header arm_core_mpu_dev.h into arch/arm/cortex_m/mpu, we need to explicitly declare the arm_core_mpu_disable() function in the userspace test. Note that arm_core_mpu_disable() (as any other function in this internal API) is not supposed to be called directly by kernel/application functions; an exception is allowed in this test suite, so we are able to test the MPU disabling functionality. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
arm_core_mpu_enable() and arm_core_mpu_disable() functions are effectively static functions, only used in the drivers for ARM and NXP MPU, therefore, we do not need to expose them in the arm_core_mpu_dev.h header. Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
720d6a4
to
7720d45
Compare
A clean-up patch; moving an internal API header where it belongs (IMHO) :)