[Err, sorry about the empty mail...] Anyway, I'd like to hijack this thread slightly, since we are close to a subject that I've been thinking about lately, and I'd like to take advantage of the expert's attention... My mthca driver (drivers/infiniband/hw/mthca) supports mapping some MMIO registers into userspace via io_remap_pfn_range() in a .mmap method. I think I have that pretty well under control. However, on a hot unplug event, when the underlying PCI device is going away, I would like to replace that mapping with a mapping (with a mapping to the zero page?), so that userspace accesses after the device is gone don't explode. What's the "right" way to do that? Presumably it would be something like zeromap_page_range(), but that's not exported to modules. Exporting that would be one option, but in a way that's overkill for me: I only have a single page to deal with, so I could also do something like vm_insert_page(vma, addr, ZERO_PAGE(addr)); But do I have to do anything to kill the old mapping coming from remap_pfn_range()? What's the exported API to do that? I can keep a list of vmas that have registers mapped to userspace and iterate through it on hot unplug. The only question is what to do with those vmas. Thanks, Roland - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: Remapping pages mapped to userspace (was: [PATCH 10 of 20] ipath - support for userspace apps using core driver)
- From: Hugh Dickins <[email protected]>
- Re: Remapping pages mapped to userspace (was: [PATCH 10 of 20] ipath - support for userspace apps using core driver)
- From: "Bryan O'Sullivan" <[email protected]>
- Re: Remapping pages mapped to userspace (was: [PATCH 10 of 20] ipath - support for userspace apps using core driver)
- References:
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Roland Dreier <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Roland Dreier <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Andrew Morton <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Roland Dreier <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Roland Dreier <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Andrew Morton <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: "Bryan O'Sullivan" <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Andrew Morton <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- From: Hugh Dickins <[email protected]>
- Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- Prev by Date: Re: [PATCH] (-mm) drivers/pci/msi: explicit declaration of msi_register
- Next by Date: Re: [patch 1/1] consolidate TRUE and FALSE
- Previous by thread: Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
- Next by thread: Re: Remapping pages mapped to userspace (was: [PATCH 10 of 20] ipath - support for userspace apps using core driver)
- Index(es):