On 09.09.22 04:11, Stefano Stabellini wrote:
Adding more people in CCOn 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_map_cache) - QEMU calls an IOCTL to the TEE subsystem with the Virtual Address returned by dma_memory_map - Linux tee_shm_register->pin_user_pages_fast Returns -14 - drivers/tee/tee_shm.c Once upon a time it used to be the case that get_user_pages_fast would fail on Xen because we didn't have a struct page corresponding to foreign memory mappings. But that hasn't been the case for years now. Any other ideas why it would fail?
I think we can expect that access_ok() isn't failing. I assume the mapping was done allowing writes (sorry for paranoia mode)? Other than that I'm not having enough memory management skills. It might be related to mmap()-ed foreign pages having _PAGE_SPECIAL set, though. Juergen
OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature