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
2011-11-04 17:33:07 +00:00
committed by Tomas Hruby
parent 0a55e63413
commit 8fa95abae4
5 changed files with 49 additions and 2 deletions

View File

@@ -17,4 +17,18 @@
#define SET_BIT(map,bit) ( MAP_CHUNK(map,bit) |= (1 << CHUNK_OFFSET(bit) ))
#define UNSET_BIT(map,bit) ( MAP_CHUNK(map,bit) &= ~(1 << CHUNK_OFFSET(bit) ))
#if defined(CONFIG_SMP) && defined(__GNUC__)
#ifndef __ASSEMBLY__
static inline bits_fill(bitchunk_t * chunks, unsigned bits)
{
unsigned c, cnt;
cnt = BITMAP_CHUNKS(bits);
for (c = 0; c < cnt; c++)
bit_fill(chunks[c]);
}
#endif
#endif
#endif /* _BITMAP_H */