copy_user_pte: base memobj copy on range & VR_PRIVATE
Some memobjs (e.g. devobj) will not be considered 'in memobj' by page_is_in_memobj. Instead of trying to play whack-a-mole with the non-fileobj memobjs, base the copy check on range's memobj and VR_PRIVATE (do not copy MAP_SHARED mappings, so the fault handler will do the right thing™ when required) Change-Id: Ic32cdc7766754f6559753b34845eb8c5cff6ed13 Refs: #1255
This commit is contained in:
@ -640,7 +640,6 @@ static int copy_user_pte(void *arg0, page_table_t src_pt, pte_t *src_ptep, void
|
||||
struct copy_args * const args = arg0;
|
||||
int error;
|
||||
intptr_t src_phys;
|
||||
struct page *src_page;
|
||||
unsigned long src_lphys;
|
||||
void *src_kvirt;
|
||||
size_t pgsize = (size_t)1 << pgshift;
|
||||
@ -657,9 +656,8 @@ static int copy_user_pte(void *arg0, page_table_t src_pt, pte_t *src_ptep, void
|
||||
}
|
||||
|
||||
src_phys = pte_get_phys(src_ptep);
|
||||
src_page = phys_to_page(src_phys);
|
||||
|
||||
if (src_page && page_is_in_memobj(src_page)) {
|
||||
if (args->range->memobj && !(args->new_vrflag & VR_PRIVATE)) {
|
||||
error = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user