read/patch_process_vm(): map non-LWK physical addresses properly

This commit is contained in:
Balazs Gerofi
2016-07-22 20:48:54 +09:00
parent d0539a9cac
commit 57690479bd
2 changed files with 31 additions and 4 deletions

View File

@ -281,6 +281,13 @@ process_procfs_request(unsigned long rarg)
ans = -EIO;
goto end;
}
if (pa < ihk_mc_get_memory_address(IHK_MC_GMA_MAP_START, 0) ||
pa >= ihk_mc_get_memory_address(IHK_MC_GMA_MAP_END, 0)) {
ans = -EIO;
goto end;
}
va = phys_to_virt(pa);
if(readwrite)
memcpy(va, buf + ans, size);