You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Drivers: hv: mshv_vtl: fix vmemmap race in low pgmap resolver
memremap_pages() makes a pgmap visible to get_dev_pagemap() before
arch_add_memory() populates the vmemmap. A concurrent
mshv_vtl_low_huge_fault() running while another thread is still inside
MSHV_ADD_VTL0_MEMORY can resolve a pfn whose struct page sits behind an
empty vmemmap PMD, oopsing on the first page_folio() deref:
BUG: unable to handle page fault for address: ffffea000404ca08
PGD ... PUD ... PMD 0
RIP: 0010:mshv_vtl_low_huge_fault+0x4b/0x240
Call Trace:
mshv_vtl_low_fault+0xb/0x10
__do_fault+0x32/0xa0
__handle_mm_fault+0xc2f/0x2110
Replace get_dev_pagemap()-based resolution with a driver-owned RCU list
of completed VTL0 ranges. Each range is added only after
devm_memremap_pages() returns, so a hit guarantees the vmemmap is
populated and the struct page is initialized. Entries are never removed
(pgmaps live for the life of the module).
Fixes: 775741a ("Drivers: hv: mshv_vtl: use folio-aware inserters for huge VTL0 mappings")
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
0 commit comments