-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
kernel: mmu: update dependencies for x86 #85327
base: main
Are you sure you want to change the base?
kernel: mmu: update dependencies for x86 #85327
Conversation
cc @edersondisouza - do you know if there is a way to implement the missing functions for those few platforms? |
@dcpleung can you please take a look. |
tests/lib/c_lib/common/testcase.yaml
Outdated
@@ -4,6 +4,11 @@ common: | |||
ignore_faults: true | |||
integration_platforms: | |||
- mps2/an385 | |||
platform_exclude: | |||
# CONFIG_MMU=y but no arch_mem_map() or arch_mem_unmap() |
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.
hmm, if this is the only way possible, sure, but I hope we can find a solution without explicit platform excludes...
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 - there are a couple of places where we have these excludes, and I would prefer to exclude the excludes.
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.
@cfriedt looks like all posix tests are failing with this platform
see https://github.com/zephyrproject-rtos/zephyr/actions/runs/13221809114
so this exclusion is not the right solution indeed.
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 this is the same build failure, then I think the simplest workaround would be to implement an arch_mem_map()
and arch_mem_unmap()
for these platforms that fails -ENOSYS
.
The exclusion can still apply to mmap tests, but it would at least allow other applications to link.
@nashif - I think I've found a better way. Will update this PR shortly. I do not have an Testing done: # qemu_x86 still works, as expected
west build -p -b qemu_x86 -t run tests/posix/xsi_realtime
...
SUITE PASS - 100.00% [xsi_realtime]: pass = 11, fail = 0, skip = 0, total = 11 duration = 0.131 seconds
- PASS - [xsi_realtime.test_fs_datasync] duration = 0.002 seconds
- PASS - [xsi_realtime.test_fs_sync] duration = 0.001 seconds
- PASS - [xsi_realtime.test_mqueue] duration = 0.013 seconds
- PASS - [xsi_realtime.test_mqueue_notify_basic] duration = 0.001 seconds
- PASS - [xsi_realtime.test_mqueue_notify_errors] duration = 0.001 seconds
- PASS - [xsi_realtime.test_mqueue_notify_non_empty_queue] duration = 0.001 seconds
- PASS - [xsi_realtime.test_mqueue_notify_thread] duration = 0.106 seconds
- PASS - [xsi_realtime.test_shm_mmap] duration = 0.003 seconds
- PASS - [xsi_realtime.test_shm_open] duration = 0.001 seconds
- PASS - [xsi_realtime.test_shm_read_write] duration = 0.001 seconds
- PASS - [xsi_realtime.test_shm_unlink] duration = 0.001 seconds
# qemu_x86_64 still works, as expected
west build -p -b qemu_x86_64 -t run tests/posix/xsi_realtime
...
SUITE PASS - 100.00% [xsi_realtime]: pass = 11, fail = 0, skip = 0, total = 11 duration = 0.147 seconds
- PASS - [xsi_realtime.test_fs_datasync] duration = 0.004 seconds
- PASS - [xsi_realtime.test_fs_sync] duration = 0.001 seconds
- PASS - [xsi_realtime.test_mqueue] duration = 0.025 seconds
- PASS - [xsi_realtime.test_mqueue_notify_basic] duration = 0.001 seconds
- PASS - [xsi_realtime.test_mqueue_notify_errors] duration = 0.001 seconds
- PASS - [xsi_realtime.test_mqueue_notify_non_empty_queue] duration = 0.001 seconds
- PASS - [xsi_realtime.test_mqueue_notify_thread] duration = 0.110 seconds
- PASS - [xsi_realtime.test_shm_mmap] duration = 0.001 seconds
- PASS - [xsi_realtime.test_shm_open] duration = 0.001 seconds
- PASS - [xsi_realtime.test_shm_read_write] duration = 0.001 seconds
- PASS - [xsi_realtime.test_shm_unlink] duration = 0.001 seconds
# intel_ish_5_4_1, links (and should run with the mmap tests skipped)
west build -p auto -b intel_ish_5_4_1 tests/posix/common
...
Generating files from /Users/cfriedt/zephyrproject/zephyr/build/zephyr/zephyr.elf for board: intel_ish_5_4_1
Packing EC image file for ISH
kernel binary size: 94972
# intel_ish_541, links and should run as expected
west build -p auto -b intel_ish_5_4_1 tests/lib/c_lib/thrd
...
Generating files from /Users/cfriedt/zephyrproject/zephyr/build/zephyr/zephyr.elf for board: intel_ish_5_4_1
Packing EC image file for ISH
kernel binary size: 64380 |
c58e25c
to
464c1bb
Compare
Currently, some x86 platforms do not support MMU operations out-of-the-box. I don't claim to understand all of the nuances of the x86 arch by any means, so this change is mainly intended to fix a regression by only allowing MMU to be selected on x86 when x86_mmu is also selected. This affects the following platforms. * intel_ish_5_4_1 * intel_ish_5_6_0 * intel_ish_5_8_0 Previously, linking would fail because `arch_mem_map()` and `arch_mem_unmap()` were not implemented on these platforms. Signed-off-by: Chris Friedt <[email protected]>
Previously, intel_ish platforms would fail to link due to missing `arch_mem_map()` and `arch_mem_unmap()` symbols due to nuances in the x86 architecture on those platforms. The previous commit addresses this in kernel/Kconfig.vm by adding specific x86 conditions for dependencies, so the platforms no longer need to be filtered, the implementation of `mmap()` and `munmap()` on those platforms will return -1 and set errno to `ENOTSUP`. Signed-off-by: Chris Friedt <[email protected]>
464c1bb
to
0164f55
Compare
Hm?... why is |
@cfriedt should posix be implying/selecting MMU in the first place? this is something that needs to be set by the platform, so something like this:
should depend on MMU and not imply/select it |
Imply / select is correct here. The reason being that posix option groups are effectively shorthands for manually specifying a lot of dependencies. Imply is needed here because some architectures / platforms simply cannot support mmap. |
I still think it is backwards. |
The nature of POSIX Option Groups, Options, and Subprofiles is that they should be selected. All POSIX Subprofiles operate by selecting a predefined subset of Subprofiling Option Groups. In that sense, POSIX subprofiles operate as a shorthand.
There are a couple of issues still in need of attention which will alleviate concerns
|
Realistically, if we want a consistent arch interface, which is the underlying reason for the regression (not really anything to do with POSIX), someone should implement even a trivial or non-functional version of That should naturally be something that is done by an x86 arch maintainer. |
intel_ish
platformsCurrently, some x86 platforms do not support certain MMU operations out-of-the-box.
intel_ish_5_4_1
intel_ish_5_6_0
intel_ish_5_8_0
Previously, linking would fail because
arch_mem_map()
andarch_mem_unmap()
were not implemented on these platforms.I don't claim to understand all of the nuances of the x86 arch by any means, so this change is mainly intended to fix a
regression by only allowing
CONFIG_MMU
to be enabled on x86 whenCONFIG_X86_MMU
is also enabled, which ensures that the arch-specificarch_mem_map()
andarch_mem_unmap()
symbols are pulled in when possible.Fixes #85305