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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user