Fixed utcb updating issue that was a significant burden.

Any thread that touches a utcb inside the kernel now properly checks
whether the utcb is mapped on its owner, and whether the mapped physical
address matches that of the current thread's tables. If not the tables
are updated.

This way, even though page tables become incoherent on utcb address
change situations (such as fork() exit(), execve()) they get updated
as they are referenced.

Since mappings are added only conditionally, caches are flushed only
when an update is necessary.
This commit is contained in:
Bahadir Balban
2009-10-09 16:45:10 +03:00
parent a8a4b5ce6c
commit d39ffc6acd
6 changed files with 83 additions and 12 deletions

View File

@@ -57,6 +57,8 @@ void address_space_reference_unlock();
void init_address_space_list(struct address_space_list *space_list);
int check_access(unsigned long vaddr, unsigned long size,
unsigned int flags, int page_in);
int check_access_task(unsigned long vaddr, unsigned long size,
unsigned int flags, int page_in, struct ktcb *task);
#endif
#endif /* __SPACE_H__ */

View File

@@ -56,6 +56,10 @@ typedef struct msg_regs {
* These references are valid only when they have been explicitly set
* by a kernel entry point, e.g. a system call, a data abort handler
* that imitates a page fault ipc etc.
*
* Second note:
* _If_ these refer to real utcb's in the future, make sure to have
* utcb_map_lazily() check so that they're safe accesses.
*/
#define KTCB_REF_ARG0(ktcb) (&(ktcb)->syscall_regs->r0)
#define KTCB_REF_MR0(ktcb) (&(ktcb)->syscall_regs->MR0_REGISTER)