Hi.
The exact problem is a seg-fault at this
faulting line:
The fault occurs as __ept_walk_create() returns wrong pte_t* which basically contains the bad-address.
It occurs to me that it could be solved by increasing the space allocated to epm_free_list, but I might be very wrong.
If the solution to the problem comes at the cost of performance, then also its fine.
Changes I did are :-
In linux-keystone-driver/keystone-page.c
Instead of:
utm->ptr = (void*) __get_free_pages(GFP_HIGHUSER, order);
I used:
if (order <= MAX_ORDER)
utm->ptr = (void*) __get_free_pages(GFP_HIGHUSER, order);
if (!utm->ptr) {
printk(KERN_INFO "[driver] Buddy Allocator for UTM failed\n");
#ifdef CONFIG_CMA
utm->ptr = (void *) dma_alloc_coherent(keystone_dev.this_device,
count << PAGE_SHIFT,
&device_phys_addr,
GFP_KERNEL | __GFP_DMA32);
if(!device_phys_addr)
return -ENOMEM;
#endif
if(!utm->ptr)
return -ENOMEM;
}
printk(KERN_INFO "[driver] UTM INIT successful\n"); //I get this print, so I have memory
In test-runner.cpp
I have used:
params.setUntrustedSize(32*1024*(4096));
Please suggest possible solutions.
Thank you.