mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
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:
@@ -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__ */
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user