Re: dtrace return hook missing for some iokit funcs?
Re: dtrace return hook missing for some iokit funcs?
- Subject: Re: dtrace return hook missing for some iokit funcs?
- From: Michael Smith <email@hidden>
- Date: Thu, 22 Apr 2010 08:21:57 -0700
On Apr 22, 2010, at 8:05 AM, Andrew Gallatin wrote: So my code has gone from:
md = IOMemoryDescriptor::withAddress(kva, len, kIODirectionOutIn); to
md = IOMemoryDescriptor::withAddressRanges(range, num_pages, kIODirectionOutIn, kernel_task);
With suitable code to prepare IOAddressRange range, one for each page in the range.
One interesting bit is that each page already has a prepared() memory descriptor. However, I (think I) need to create a new memory descriptor to use to map them into the application virtually contiguously. Would having 2 MDs covering the same region of memory cause an issue?
It shouldn't. I don't think it's relevant, but is there a chance that another context is doing I/O against these pages while you're trying to create a new descriptor? I'm not certain what would happen if the pages were busied at the time you tried to increment their wire count.
I think I know why you're doing this, but I would want to encourage anyone else reading this later for ideas; avoid vending kernel memory to user process if at all possible; you should generally always allocate memory in process context and then pass it to the kernel.
= Mike
-- Ars longa, vita brevis, occasio praeceps, experimentum periculosum, iudicium difficile -- Hippocrates
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden