Re: Linux pin_user_pages_fast fails on Xen

2022-09-15 Thread Stefano Stabellini
On Thu, 15 Sep 2022, Juergen Gross wrote: > On 15.09.22 03:18, Stefano Stabellini wrote: > > On Wed, 14 Sep 2022, Jan Beulich wrote: > > > On 14.09.2022 01:31, Stefano Stabellini wrote: > > > > The problem is that drivers/xen/privcmd.c:privcmd_mmap sets VM_IO | > > > > VM_PFNMAP, and either flag wo

Re: Linux pin_user_pages_fast fails on Xen

2022-09-15 Thread Jan Beulich
On 15.09.2022 03:18, Stefano Stabellini wrote: > On Wed, 14 Sep 2022, Jan Beulich wrote: >> I did look some at the specific use by the TEE subsystem, and it looks >> to me as if their "shared memory" machinery simply isn't meant to be >> used with non-local memory. > > Any more info? I guess that

Re: Linux pin_user_pages_fast fails on Xen

2022-09-14 Thread Juergen Gross
On 15.09.22 03:18, Stefano Stabellini wrote: On Wed, 14 Sep 2022, Jan Beulich wrote: On 14.09.2022 01:31, Stefano Stabellini wrote: The problem is that drivers/xen/privcmd.c:privcmd_mmap sets VM_IO | VM_PFNMAP, and either flag would cause check_vma_flags to return -EFAULT. Do you know if it wo

Re: Linux pin_user_pages_fast fails on Xen

2022-09-14 Thread Stefano Stabellini
On Wed, 14 Sep 2022, Jan Beulich wrote: > On 14.09.2022 01:31, Stefano Stabellini wrote: > > The problem is that drivers/xen/privcmd.c:privcmd_mmap sets VM_IO | > > VM_PFNMAP, and either flag would cause check_vma_flags to return > > -EFAULT. > > > > Do you know if it works if you remove VM_IO | V

Re: Linux pin_user_pages_fast fails on Xen

2022-09-13 Thread Jan Beulich
On 14.09.2022 01:31, Stefano Stabellini wrote: > The problem is that drivers/xen/privcmd.c:privcmd_mmap sets VM_IO | > VM_PFNMAP, and either flag would cause check_vma_flags to return > -EFAULT. > > Do you know if it works if you remove VM_IO | VM_PFNMAP from > privcmd_mmap? My Linux MM knowledge

RE: Linux pin_user_pages_fast fails on Xen

2022-09-13 Thread NK, JESHWANTHKUMAR (JESHWANTH KUMAR)
jo-john ; jgr...@suse.com Subject: RE: Linux pin_user_pages_fast fails on Xen The problem is that drivers/xen/privcmd.c:privcmd_mmap sets VM_IO | VM_PFNMAP, and either flag would cause check_vma_flags to return -EFAULT. Do you know if it works if you remove VM_IO | VM_PFNMAP from privcmd_mmap? Juergen

RE: Linux pin_user_pages_fast fails on Xen

2022-09-13 Thread Stefano Stabellini
gt; Devaraj ; Pandeshwara krishna, Mythri > ; SK, SivaSangeetha (Siva Sangeetha) > ; Thomas, Rijo-john ; > jgr...@suse.com > Subject: RE: Linux pin_user_pages_fast fails on Xen > > [AMD Official Use Only - General] > > Hi Stefano, > > https://elixir.boo

RE: Linux pin_user_pages_fast fails on Xen

2022-09-12 Thread NK, JESHWANTHKUMAR (JESHWANTH KUMAR)
om Subject: RE: Linux pin_user_pages_fast fails on Xen [AMD Official Use Only - General] Hi Stefano, https://elixir.bootlin.com/linux/v5.16/source/mm/gup.c#L975 is the -EFAULT returning for our current use case. access_ok is fine. Regards, Jeshwanth -Original Message- From: Stefano

RE: Linux pin_user_pages_fast fails on Xen

2022-09-12 Thread NK, JESHWANTHKUMAR (JESHWANTH KUMAR)
Subject: Re: Linux pin_user_pages_fast fails on Xen On Sat, 10 Sep 2022, Juergen Gross wrote: > On 09.09.22 22:25, Stefano Stabellini wrote: > > On Fri, 9 Sep 2022, Juergen Gross wrote: > > > On 09.09.22 04:11, Stefano Stabellini wrote: > > > > Adding more people in CC

Re: Linux pin_user_pages_fast fails on Xen

2022-09-12 Thread Stefano Stabellini
On Sat, 10 Sep 2022, Juergen Gross wrote: > On 09.09.22 22:25, Stefano Stabellini wrote: > > On Fri, 9 Sep 2022, Juergen Gross wrote: > > > On 09.09.22 04:11, Stefano Stabellini wrote: > > > > Adding more people in CC > > > > > > > > On Thu, 8 Sep 2022, Stefano Stabellini wrote: > > > > > Hi Juerg

Re: Linux pin_user_pages_fast fails on Xen

2022-09-09 Thread Juergen Gross
On 09.09.22 22:25, Stefano Stabellini wrote: On Fri, 9 Sep 2022, Juergen Gross wrote: On 09.09.22 04:11, Stefano Stabellini wrote: Adding more people in CC On Thu, 8 Sep 2022, Stefano Stabellini wrote: Hi Juergen, A colleague is seeing a failure on x86 in Linux Dom0. The failure is pin_user_

Re: Linux pin_user_pages_fast fails on Xen

2022-09-09 Thread Stefano Stabellini
On Fri, 9 Sep 2022, Juergen Gross wrote: > On 09.09.22 04:11, Stefano Stabellini wrote: > > Adding more people in CC > > > > On Thu, 8 Sep 2022, Stefano Stabellini wrote: > > > Hi Juergen, > > > > > > A colleague is seeing a failure on x86 in Linux Dom0. The failure is > > > pin_user_pages_fast w

Re: Linux pin_user_pages_fast fails on Xen

2022-09-08 Thread Juergen Gross
On 09.09.22 04:11, Stefano Stabellini wrote: Adding more people in CC On Thu, 8 Sep 2022, Stefano Stabellini wrote: Hi Juergen, A colleague is seeing a failure on x86 in Linux Dom0. The failure is pin_user_pages_fast with addresses that correspond to foreign memory pages: - QEMU maps a domU a

Re: Linux pin_user_pages_fast fails on Xen

2022-09-08 Thread Stefano Stabellini
Adding more people in CC On Thu, 8 Sep 2022, Stefano Stabellini wrote: > Hi Juergen, > > A colleague is seeing a failure on x86 in Linux Dom0. The failure is > pin_user_pages_fast with addresses that correspond to foreign memory > pages: > > - QEMU maps a domU address using dma_memory_map (xen_m