xref: /openbmc/linux/arch/x86/include/asm/io_bitmap.h (revision 99bcd4a6e5b8ba201fdd252f1054689884899fee)
1577d5cd7SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0 */
2577d5cd7SThomas Gleixner #ifndef _ASM_X86_IOBITMAP_H
3577d5cd7SThomas Gleixner #define _ASM_X86_IOBITMAP_H
4577d5cd7SThomas Gleixner 
54804e382SThomas Gleixner #include <linux/refcount.h>
6577d5cd7SThomas Gleixner #include <asm/processor.h>
7577d5cd7SThomas Gleixner 
8577d5cd7SThomas Gleixner struct io_bitmap {
9060aa16fSThomas Gleixner 	u64		sequence;
104804e382SThomas Gleixner 	refcount_t	refcnt;
11577d5cd7SThomas Gleixner 	/* The maximum number of bytes to copy so all zero bits are covered */
12577d5cd7SThomas Gleixner 	unsigned int	max;
13577d5cd7SThomas Gleixner 	unsigned long	bitmap[IO_BITMAP_LONGS];
14577d5cd7SThomas Gleixner };
15577d5cd7SThomas Gleixner 
164804e382SThomas Gleixner struct task_struct;
174804e382SThomas Gleixner 
18111e7b15SThomas Gleixner #ifdef CONFIG_X86_IOPL_IOPERM
194804e382SThomas Gleixner void io_bitmap_share(struct task_struct *tsk);
20ea5f1cd7SThomas Gleixner void io_bitmap_exit(void);
21ea5f1cd7SThomas Gleixner 
22*99bcd4a6SJuergen Gross void native_tss_update_io_bitmap(void);
23*99bcd4a6SJuergen Gross 
24*99bcd4a6SJuergen Gross #ifdef CONFIG_PARAVIRT_XXL
25*99bcd4a6SJuergen Gross #include <asm/paravirt.h>
26*99bcd4a6SJuergen Gross #else
27*99bcd4a6SJuergen Gross #define tss_update_io_bitmap native_tss_update_io_bitmap
28*99bcd4a6SJuergen Gross #endif
29*99bcd4a6SJuergen Gross 
30111e7b15SThomas Gleixner #else
31111e7b15SThomas Gleixner static inline void io_bitmap_share(struct task_struct *tsk) { }
32111e7b15SThomas Gleixner static inline void io_bitmap_exit(void) { }
33111e7b15SThomas Gleixner static inline void tss_update_io_bitmap(void) { }
34111e7b15SThomas Gleixner #endif
3522fe5b04SThomas Gleixner 
36577d5cd7SThomas Gleixner #endif
37