-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
HiKey960, pager: SDP test hangs (xtest 1014.3) #4499
Comments
So apparently commit d6ad67f ("core: mm: change vm_pa2va() to return a virtual address") did not only change the return type, it changed the logic too. The following patches fixes the issue for me, @etienne-lms can you please check if that makes sense? Thanks. diff --git a/core/mm/vm.c b/core/mm/vm.c
index a6c59861..4cd491c5 100644
--- a/core/mm/vm.c
+++ b/core/mm/vm.c
@@ -1198,8 +1198,6 @@ void *vm_pa2va(const struct user_mode_ctx *uctx, paddr_t pa)
assert(!granule || IS_POWER_OF_TWO(granule));
for (ofs = region->offset; ofs < region->size; ofs += size) {
- if (mobj_get_pa(region->mobj, ofs, granule, &p))
- continue;
if (granule) {
/* From current offset to buffer/granule end */
@@ -1211,6 +1209,9 @@ void *vm_pa2va(const struct user_mode_ctx *uctx, paddr_t pa)
size = region->size;
}
+ if (mobj_get_pa(region->mobj, ofs, granule, &p))
+ return NULL;
+
if (core_is_buffer_inside(pa, 1, p, size)) {
/* Remove region offset (mobj phys offset) */
ofs -= region->offset; |
thanks for the report. Indeed, i was too quick on moving if (mobj_get_pa(region->mobj, ofs, granule, &p))
return NULL; should be replaced with: if (mobj_get_pa(region->mobj, ofs, granule, &p))
continue; I think, since since phys address can be found for the area, the loop should try next areas, eventually not find any suitable one and ending with the final I'll test that on Qemu with SDP. |
@etienne-lms yes that makes sense and works in my tests too. |
I have tested |
Building for HiKey960 with command:
make -j10 CFG_WITH_PAGER=y CFG_TEE_CORE_EMBED_INTERNAL_TESTS=y CFG_TEE_CORE_LOG_LEVEL=2
SDP test 1014.3 hangs and cannot be interrupted with Ctrl+C:
Bisected down to commit d6ad67f ("core: mm: change vm_pa2va() to return a virtual address").
The text was updated successfully, but these errors were encountered: