Re: [Xen-devel] DomU application crashes while mmap'ing device memory on x86_64

2016-11-30 Thread Oleksandr Andrushchenko
Thank you for explanation, now it is clear. BTW, is PAGE_SHARED the right choice in my case or should I use something else instead? Thank you, Oleksandr On 11/30/2016 09:10 PM, Andrew Cooper wrote: On 30/11/16 19:00, Oleksandr Andrushchenko wrote: I traced the problem down to vma->vm_page_pr

Re: [Xen-devel] DomU application crashes while mmap'ing device memory on x86_64

2016-11-30 Thread Andrew Cooper
On 30/11/16 19:00, Oleksandr Andrushchenko wrote: > I traced the problem down to vma->vm_page_prot which > > in my case is set as: > > vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); > > This sets additional flags _PAGE_BIT_PSE/_PAGE_BIT_PAT +_PAGE_BIT_PCD > > so after that remap_pfn_range

Re: [Xen-devel] DomU application crashes while mmap'ing device memory on x86_64

2016-11-30 Thread Oleksandr Andrushchenko
I traced the problem down to vma->vm_page_prot which in my case is set as: vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); This sets additional flags _PAGE_BIT_PSE/_PAGE_BIT_PAT +_PAGE_BIT_PCD so after that remap_pfn_range makes Xen complain. (pgprot_noncached(vma->vm_page_prot) == 0

Re: [Xen-devel] DomU application crashes while mmap'ing device memory on x86_64

2016-11-22 Thread Oleksandr Andrushchenko
Hi, just wanted to bump this as I also have the same issue on real HW now (x86_64) Nov 14 10:30:18 DomU kernel: [ 1169.569936] [] xen_mc_flush+0x19c/0x1b0 Thank you in advnce, Oleksandr On Mon, Nov 14, 2016 at 6:07 PM, Oleksandr Andrushchenko wrote: > Hi, there! > > Sorry for the long read a

[Xen-devel] DomU application crashes while mmap'ing device memory on x86_64

2016-11-14 Thread Oleksandr Andrushchenko
Hi, there! Sorry for the long read ahead, but it seems I've got stuck... I am working on a PV driver and facing an mmap issue. This actually happens when user-space tries to mmap the memory allocated by the driver: cma_obj->vaddr = dma_alloc_wc(drm->dev, size, &cma_obj->paddr, GFP_KERNEL |