lkml.org 
[lkml]   [2006]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRemapping pages mapped to userspace (was: [PATCH 10 of 20] ipath - support for userspace apps using core driver)
From
Date
[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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-17 00:54    [W:0.245 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site