0001
0002 #ifndef _ASM_X86_IOBITMAP_H
0003 #define _ASM_X86_IOBITMAP_H
0004
0005 #include <linux/refcount.h>
0006 #include <asm/processor.h>
0007
0008 struct io_bitmap {
0009 u64 sequence;
0010 refcount_t refcnt;
0011
0012 unsigned int max;
0013 unsigned long bitmap[IO_BITMAP_LONGS];
0014 };
0015
0016 struct task_struct;
0017
0018 #ifdef CONFIG_X86_IOPL_IOPERM
0019 void io_bitmap_share(struct task_struct *tsk);
0020 void io_bitmap_exit(struct task_struct *tsk);
0021
0022 static inline void native_tss_invalidate_io_bitmap(void)
0023 {
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 this_cpu_write(cpu_tss_rw.x86_tss.io_bitmap_base,
0034 IO_BITMAP_OFFSET_INVALID);
0035 }
0036
0037 void native_tss_update_io_bitmap(void);
0038
0039 #ifdef CONFIG_PARAVIRT_XXL
0040 #include <asm/paravirt.h>
0041 #else
0042 #define tss_update_io_bitmap native_tss_update_io_bitmap
0043 #define tss_invalidate_io_bitmap native_tss_invalidate_io_bitmap
0044 #endif
0045
0046 #else
0047 static inline void io_bitmap_share(struct task_struct *tsk) { }
0048 static inline void io_bitmap_exit(struct task_struct *tsk) { }
0049 static inline void tss_update_io_bitmap(void) { }
0050 #endif
0051
0052 #endif