-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux 5.2.x breaks VM start - qubes-db fails to start #5199
Comments
As @m-v-b found, it's most likely caused by https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=df9bde015a72ffd978e39a750662c7cf579b1715 I suspect it's about |
Hello again, My kernel build has finally successfully finished. I carried a few basic boot-up tests with AppVMs, and I confirm that reverting the commit at https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=df9bde015a72ffd978e39a750662c7cf579b1715 resolves this issue.
Addendum: |
Relevant discussion: https://lore.kernel.org/lkml/CAFqt6zZN+6r6wYJY+f15JAjj8dY+o30w_+EWH9Vy2kUXCKSBog@mail.gmail.com/ @m-v-b could you test replacing |
@marmarek, of course, I do not mind helping with that. Please note that I need about 12 to 16 hours before I can report back with the test results, mostly due to my employment/work. If such a time frame would be too late, please let me know. |
I'm testing it already. |
It works. |
Fix queued in 5.2-stable already. |
@marmarek would it be possible to push out a new |
As soon as it will be released (5.2.7), which should happen this week. |
commit 8d1502f upstream. 'commit df9bde0 ("xen/gntdev.c: convert to use vm_map_pages()")' breaks gntdev driver. If vma->vm_pgoff > 0, vm_map_pages() will: - use map->pages starting at vma->vm_pgoff instead of 0 - verify map->count against vma_pages()+vma->vm_pgoff instead of just vma_pages(). In practice, this breaks using a single gntdev FD for mapping multiple grants. relevant strace output: [pid 857] ioctl(7, IOCTL_GNTDEV_MAP_GRANT_REF, 0x7ffd3407b6d0) = 0 [pid 857] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 7, 0) = 0x777f1211b000 [pid 857] ioctl(7, IOCTL_GNTDEV_SET_UNMAP_NOTIFY, 0x7ffd3407b710) = 0 [pid 857] ioctl(7, IOCTL_GNTDEV_MAP_GRANT_REF, 0x7ffd3407b6d0) = 0 [pid 857] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 7, 0x1000) = -1 ENXIO (No such device or address) details here: QubesOS/qubes-issues#5199 The reason is -> ( copying Marek's word from discussion) vma->vm_pgoff is used as index passed to gntdev_find_map_index. It's basically using this parameter for "which grant reference to map". map struct returned by gntdev_find_map_index() describes just the pages to be mapped. Specifically map->pages[0] should be mapped at vma->vm_start, not vma->vm_start+vma->vm_pgoff*PAGE_SIZE. When trying to map grant with index (aka vma->vm_pgoff) > 1, __vm_map_pages() will refuse to map it because it will expect map->count to be at least vma_pages(vma)+vma->vm_pgoff, while it is exactly vma_pages(vma). Converting vm_map_pages() to use vm_map_pages_zero() will fix the problem. Marek has tested and confirmed the same. Cc: stable@vger.kernel.org # v5.2+ Fixes: df9bde0 ("xen/gntdev.c: convert to use vm_map_pages()") Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel-latest-qubes-vm-5.2.7 is in current-testing: QubesOS/updates-status#1248 |
Qubes OS version
4.0
Affected component(s) or functionality
Linux / vchan
Brief summary
With update to Linux 5.2.x, qubes-db service fails to start with
gnttab: error: mmap failed: No such device or address
error.To Reproduce
Steps to reproduce the behavior:
virt_mode
is set topvh
Expected behavior
VM starts normally
Actual behavior
VM either crash on start (report on IRC by @xaki23), or just qubes-db fails to start leaving VM half-configured.
Logs from service start, with xen_gntdev debugging enabled:
strace fragment:
cc @m-v-b
The text was updated successfully, but these errors were encountered: