Merge branch 'postk_topic-contiguous_pte' into development

* Merge cd7ab307fae9bc8aa49d23b32becf37368a1603e
* Merge commit is changed to one commit for gerrit

Change-Id: I75f0f4cf6b8b3286284638ac2c7816c5257551e4
This commit is contained in:
Dominique Martinet
2019-01-31 11:03:46 +09:00
parent 7f1c17fc4c
commit 6d38c34993
55 changed files with 2757 additions and 17 deletions

View File

@ -781,12 +781,12 @@ static inline int page_is_contiguous_tail(pte_t *ptep, size_t pgsize)
return (ptr == ptep);
}
void arch_adjust_allocate_page_size(uintptr_t fault_addr,
struct page_table;
void arch_adjust_allocate_page_size(struct page_table *pt,
uintptr_t fault_addr,
pte_t *ptep,
void **pgaddrp,
size_t *pgsizep);
struct page_table;
void set_pte(pte_t *ppte, unsigned long phys, enum ihk_mc_pt_attribute attr);
pte_t *get_pte(struct page_table *pt, void *virt, enum ihk_mc_pt_attribute attr);

View File

@ -2356,9 +2356,6 @@ static int clear_range(struct page_table *pt, struct process_vm *vm,
dkprintf("%s: %p,%lx,%lx,%d,%p\n",
__func__, pt, start, end, free_physical, memobj);
dkprintf("%s: %p,%lx,%lx,%d,%p\n",
__func__, pt, start, end, free_physical, memobj);
if ((start < vm->region.user_start)
|| (vm->region.user_end < end)
|| (end <= start)) {
@ -3155,7 +3152,8 @@ static int move_one_page(void *arg0, page_table_t pt, pte_t *ptep,
attr = apte & ~PT_PHYSMASK;
error = ihk_mc_pt_set_range(pt, args->vm, (void *)dest,
(void *)(dest + pgsize), phys, attr, pgshift, args->range, 0);
(void *)(dest + pgsize), phys, attr,
pgshift, args->range, 0);
if (error) {
kprintf("move_one_page(%p,%p,%p %#lx,%p,%d):"
"set failed. %d\n",
@ -3779,16 +3777,38 @@ void remote_flush_tlb_cpumask(struct process_vm *vm,
}
#endif /* POSTK_DEBUG_ARCH_DEP_8 */
void arch_adjust_allocate_page_size(uintptr_t fault_addr,
void arch_adjust_allocate_page_size(struct page_table *pt,
uintptr_t fault_addr,
pte_t *ptep,
void **pgaddrp,
size_t *pgsizep)
{
int level;
if (!pgsize_is_contiguous(*pgsizep)) {
return;
}
if (ptep == NULL) {
int level = pgsize_to_tbllv(*pgsizep);
*pgsizep = tbllv_to_pgsize(level);
*pgaddrp = (void *)__page_align(fault_addr, *pgsizep);
} else if (pte_is_null(ptep) && pgsize_is_contiguous(*pgsizep)) {
void *ptr = get_translation_table(pt);
int i;
// Check the entries of the upper page table.
// When PTE_NULL, do not change from the size of ContiguousPTE.
level = pgsize_to_tbllv(*pgsizep);
for (i = 4; i > 0; i--) {
ptr = ptl_offset(ptr, fault_addr, i);
if (ptl_null(ptr, i)) {
if (level < i) {
return;
}
ptep = ptr;
break;
}
}
}
if (pte_is_null(ptep)) {
struct memobj *obj;
uintptr_t zeropage = NOPHYS;
pte_t *head;
@ -3803,7 +3823,6 @@ void arch_adjust_allocate_page_size(uintptr_t fault_addr,
tail = get_contiguous_tail(ptep, *pgsizep);
for (/*nop*/; head <= tail; head++) {
uintptr_t phys;
int level;
if (pte_is_null(head)) {
continue;

View File

@ -416,14 +416,14 @@ static inline int page_is_contiguous_tail(pte_t *ptep, size_t pgsize)
return 0;
}
static inline void arch_adjust_allocate_page_size(uintptr_t fault_addr,
struct page_table;
static inline void arch_adjust_allocate_page_size(struct page_table *pt,
uintptr_t fault_addr,
pte_t *ptep,
void **pgaddrp,
size_t *pgsizep)
{
}
struct page_table;
void set_pte(pte_t *ppte, unsigned long phys, enum ihk_mc_pt_attribute attr);
pte_t *get_pte(struct page_table *pt, void *virt, enum ihk_mc_pt_attribute attr);