Ignore suspicious wake-up messages on OKL4

This commit is contained in:
Norman Feske 2012-03-23 17:22:49 +01:00
parent 8bd02a5333
commit 22084dbfa5
3 changed files with 17 additions and 8 deletions

View File

@ -77,6 +77,7 @@ namespace Genode {
Okl4::L4_MsgTag_t _faulter_tag; /* fault flags */
Okl4::L4_ThreadId_t _last; /* faulted thread */
Okl4::L4_Word_t _last_space; /* space of faulted thread */
Okl4::L4_Word_t _fault_addr; /* page-fault address */
Okl4::L4_Word_t _fault_ip; /* instruction pointer of faulter */
Mapping _reply_mapping; /* page-fault answer */
@ -148,6 +149,11 @@ namespace Genode {
*/
Native_thread_id last() const { return _last; }
/**
* Return address space where the last page fault occurred
*/
unsigned long last_space() const { return _last_space; }
/**
* Return badge for faulting thread
*

View File

@ -108,6 +108,7 @@ void Ipc_pager::wait_for_fault()
if (verbose_page_fault)
print_page_fault(L4_Label(_faulter_tag), _fault_addr, _fault_ip, _last.raw);
}
_last_space = L4_SenderSpace().raw;
}

View File

@ -54,14 +54,16 @@ void Pager_activation_base::entry()
} else {
/* prevent threads outside of core to mess with our wake-up interface */
// enum { CORE_TASK_ID = 4 };
// if (pager.last() != CORE_TASK_ID) {
#warning Check for messages from outside of core
if (0) {
} else {
/*
* Prevent threads outside of core to mess with our wake-up
* interface. This condition can trigger if a process gets
* destroyed which triggered a page fault shortly before getting
* killed. In this case, 'wait_for_fault()' returns (because of
* the page fault delivery) but the pager-object lookup will fail
* (because core removed the process already).
*/
enum { CORE_SPACE = 0 };
if (pager.last_space() == CORE_SPACE) {
/*
* We got a request from one of cores region-manager sessions