ContiguousPTE[9/12] modify ihk_mc_pt_clear|free_range
Change-Id: I75d821b81d351f4fdfd504c791543db174634261
This commit is contained in:
committed by
Masamichi Takagi
parent
c4e5bf6d6b
commit
50de3820ad
@ -1981,6 +1981,8 @@ static int clear_range(struct page_table *pt, struct process_vm *vm,
|
||||
int error;
|
||||
struct clear_range_args args;
|
||||
translation_table_t* tt;
|
||||
pte_t *ptep;
|
||||
size_t pgsize;
|
||||
|
||||
if ((start < vm->region.user_start)
|
||||
|| (vm->region.user_end < end)
|
||||
@ -2001,6 +2003,30 @@ static int clear_range(struct page_table *pt, struct process_vm *vm,
|
||||
args.memobj = memobj;
|
||||
args.vm = vm;
|
||||
|
||||
ptep = ihk_mc_pt_lookup_pte(pt, (void *)start,
|
||||
0, NULL, &pgsize, NULL);
|
||||
if (ptep && pte_is_contiguous(ptep)) {
|
||||
if (!page_is_contiguous_head(ptep, pgsize)) {
|
||||
// start pte is not contiguous head
|
||||
error = split_contiguous_pages(ptep, pgsize);
|
||||
if (error) {
|
||||
return error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ptep = ihk_mc_pt_lookup_pte(pt, (void *)end - 1,
|
||||
0, NULL, &pgsize, NULL);
|
||||
if (ptep && pte_is_contiguous(ptep)) {
|
||||
if (!page_is_contiguous_tail(ptep, pgsize)) {
|
||||
// end pte is not contiguous tail
|
||||
error = split_contiguous_pages(ptep, pgsize);
|
||||
if (error) {
|
||||
return error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tt = get_translation_table(pt);
|
||||
error = initial_lookup.walk(tt, 0, start, end, initial_lookup.callback, &args);
|
||||
return error;
|
||||
|
||||
Reference in New Issue
Block a user