SMP - fixed usage of stale TLB entries

- when kernel copies from userspace, it must be sure that the TLB
  entries are not stale and thus the referenced memory is correct

- everytime we change a process' address space we set p_stale_tlb
  bits for all CPUs.

- Whenever a cpu finds its bit set when it wants to access the
  process' memory, it refreshes the TLB

- it is more conservative than it needs to be but it has low
  overhead than checking precisely
This commit is contained in:
Tomas Hruby
2012-01-13 11:30:00 +00:00
committed by Tomas Hruby
parent 0a55e63413
commit 8fa95abae4
5 changed files with 49 additions and 2 deletions
+5
View File
@@ -38,6 +38,11 @@ struct proc {
bitchunk_t p_cpu_mask[BITMAP_CHUNKS(CONFIG_MAX_CPUS)]; /* what CPUs is hte
process allowed to
run on */
bitchunk_t p_stale_tlb[BITMAP_CHUNKS(CONFIG_MAX_CPUS)]; /* On which cpu are
possibly stale entries from this process and has
to be fresed the next kernel touches this
processes memory
*/
#endif
/* Accounting statistics that get passed to the process' scheduler */