diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2008-11-27 01:37:52 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-18 00:27:21 +0200 |
commit | 56ff60294ba81457e453b688cbec314f92f0fff3 (patch) | |
tree | e725ae7becf113b18952e5c6e7d1f3bbef59dbb6 | |
parent | a2432a9b39b470aace2210f9cc4fb790df9c8702 (diff) |
2008-11-27 Samuel Thibault <samuel.thibault@ens-lyon.org>
* i386/i386/proc_reg.h (invlpg): New macro.
* i386/intel/pmap.c (INVALIDATE_TLB): If portion to be flushed is less
than 32 pages, use calls to invlpg instead of flush_tlb.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | i386/i386/proc_reg.h | 5 | ||||
-rw-r--r-- | i386/intel/pmap.c | 8 |
3 files changed, 18 insertions, 1 deletions
@@ -1,3 +1,9 @@ +2008-11-27 Samuel Thibault <samuel.thibault@ens-lyon.org> + + * i386/i386/proc_reg.h (invlpg): New macro. + * i386/intel/pmap.c (INVALIDATE_TLB): If portion to be flushed is less + than 32 pages, use calls to invlpg instead of flush_tlb. + 2008-11-23 Samuel Thibault <samuel.thibault@ens-lyon.org> * i386/i386/proc_reg.h (get_cr0, get_cr2, get_cr3, get_cr4, get_tr, diff --git a/i386/i386/proc_reg.h b/i386/i386/proc_reg.h index 7ccc2aa..368ea25 100644 --- a/i386/i386/proc_reg.h +++ b/i386/i386/proc_reg.h @@ -134,6 +134,11 @@ set_eflags(unsigned eflags) #define flush_tlb() set_cr3(get_cr3()) +#define invlpg(addr) \ + ({ \ + asm volatile("invlpg (%0)" : : "r" (addr)); \ + }) + #define get_cr4() \ ({ \ register unsigned int _temp__; \ diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index 697e5f8..02482ae 100644 --- a/i386/intel/pmap.c +++ b/i386/intel/pmap.c @@ -332,7 +332,13 @@ lock_data_t pmap_system_lock; #define MAX_TBIS_SIZE 32 /* > this -> TBIA */ /* XXX */ #define INVALIDATE_TLB(s, e) { \ - flush_tlb(); \ + if (((e) - (s)) > 32 * PAGE_SIZE) { \ + flush_tlb(); \ + } else { \ + vm_offset_t i; \ + for (i = s; i < e; i += PAGE_SIZE) \ + invlpg(i); \ + } \ } |