Re: interrupt routine and application pages
- From: soviet_bloke@xxxxxxxxxxx
- Date: 28 Oct 2006 16:17:31 -0700
I am able to see the right
application stack in the interrupt context.
Indeed, you should be able to see it from ISR - for the time being, you
are still in the context of interrupted thread. However, by the time
DPC routine gets executed, you will be already in context of Idle
thread......
But the problem is that when lots
of page swapping happens, I get bugcheck xD1.
This is understandable......
So I am looking for way to
validate address, before actual read operation.
The "golden rule" of accessing memory at IRQL >=DISPATCH_LEVEL is that
you cannot assume *ANYTHING* about memory that you haven't locked in
advance. This is particularly true on SMP machines. On UP machine you
can try MmIsAddressValid(), because you can be 100% sure that, once
your code runs at raised IRQL, Memory Manager just had no chance to
swap the page in the period between MmIsAddressValid() had read the
page table
and the moment you tried to access it. However, it does not work this
way on SMP machine, for understandable reasons....
In fact, according to Doron, MmIsAddressValid() is Memory Manager's
internal function that should not be called by drivers
As you can see, there is no easy solution to your problem. What are
you trying to do, in the first place????? If you tell us more about
your objectives, probably, we will be able to propose you some
alternative solution.
Anton Bassov
RJ wrote:
I didn't see his reply, when I sent my email. I am able to see the right
application stack in the interrupt context. But the problem is that when lots
of page swapping happens, I get bugcheck xD1. So I am looking for way to
validate address, before actual read operation.
Thanks
RJ
"soviet_bloke@xxxxxxxxxxx" wrote:
I appreciate your advice.DPC is also okay for me
It looks like Skywing was just wasting his time, explaining to you that
DPCs run in context of Idle thread, rather than interrupted one (which
means that your DPC routine has no chance to be *EVER* executed in
context of the thread you are interested in).....
Anton Bassov
RJ wrote:
Hi Pavel/Don,
I appreciate your advice.DPC is also okay for me. Also if the stack pages
are paged out, I can ignore this situation. I only need to check the stack if
the pages are still available. So I need a mechanism to check if a particular
stack address is valid, if yes, read the address. If no, ignore.The situation
I need to protect is time between the validity check and read operation.
Thanks,
RJ
"Pavel A." wrote:
"RJ" <RJ@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:C60CC328-2272-45D7-9611-DC859F738C1F@xxxxxxxxxxxxxxxx
Hello,
I have a requirement to examine currently running application stack on an
interrupt routine. Is it safe to read application memory on an interrupt
routine? What is IRQL at which page swapping happens? What is the mechanism
that can be used to make sure that memory area is safe to read?
I would like to use "MmProbeAndLockPages", but it can be used only <=
APC_LEVEL
Speaking of requirements... hmm... you don't have to do this in
the ISR at DIRQL. A DPC allows much more and is suitable for the task,
because the app won't have chance to run before the DPC exits.
Also, consider that the app and the ISR can run on different CPUs.
--PA
.
- Follow-Ups:
- References:
- Re: interrupt routine and application pages
- From: Pavel A.
- Re: interrupt routine and application pages
- From: soviet_bloke
- Re: interrupt routine and application pages
- Prev by Date: Re: interrupt routine and application pages
- Next by Date: Re: interrupt routine and application pages
- Previous by thread: Re: interrupt routine and application pages
- Next by thread: Re: interrupt routine and application pages
- Index(es):
Relevant Pages
|
|