X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-x86_64%2Fmach-xen%2Fasm%2Ftlbflush.h;h=1836b0034930e8973939f90022d0138dde2b975f;hb=refs%2Fremotes%2Fvserver;hp=3a817746c286fcad5897de24eb1b3fe3a3273b7e;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/include/asm-x86_64/mach-xen/asm/tlbflush.h b/include/asm-x86_64/mach-xen/asm/tlbflush.h index 3a817746c..1836b0034 100644 --- a/include/asm-x86_64/mach-xen/asm/tlbflush.h +++ b/include/asm-x86_64/mach-xen/asm/tlbflush.h @@ -4,18 +4,35 @@ #include #include -#define __flush_tlb() xen_tlb_flush() +static inline unsigned long get_cr3(void) +{ + unsigned long cr3; + asm volatile("mov %%cr3,%0" : "=r" (cr3)); + return machine_to_phys(cr3); +} -/* - * Global pages have to be flushed a bit differently. Not a real - * performance problem because this does not happen often. - */ -#define __flush_tlb_global() xen_tlb_flush() +static inline void set_cr3(unsigned long cr3) +{ + BUG(); + /* What the hell is this supposed to do: JQ */ + asm volatile("mov %0,%%cr3" :: "r" (cr3) : "memory"); +} +#define __flush_tlb() xen_tlb_flush() + +static inline unsigned long get_cr4(void) +{ + unsigned long cr4; + asm volatile("mov %%cr4,%0" : "=r" (cr4)); + return cr4; +} -extern unsigned long pgkern_mask; +static inline void set_cr4(unsigned long cr4) +{ + asm volatile("mov %0,%%cr4" :: "r" (cr4) : "memory"); +} -#define __flush_tlb_all() __flush_tlb_global() +#define __flush_tlb_all() xen_tlb_flush() #define __flush_tlb_one(addr) xen_invlpg((unsigned long)addr)