summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/io_bitmap.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2020-07-25 13:16:16 +0300
committerIngo Molnar <mingo@kernel.org>2020-07-25 13:16:16 +0300
commitfb4405ae6e1c66277b7d69d2c7a34215671da585 (patch)
tree95a24efe3a3ca90a4b041d5ca548c2d37eac1ae8 /arch/x86/include/asm/io_bitmap.h
parentc9a1ff316bc9b1d1806a4366d0aef6e18833ba52 (diff)
parentba47d845d715a010f7b51f6f89bae32845e6acb7 (diff)
downloadlinux-fb4405ae6e1c66277b7d69d2c7a34215671da585.tar.xz
Merge tag 'v5.8-rc6' into x86/cpu, to refresh the branch before adding new commits
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/include/asm/io_bitmap.h')
-rw-r--r--arch/x86/include/asm/io_bitmap.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/include/asm/io_bitmap.h b/arch/x86/include/asm/io_bitmap.h
index ac1a99ffbd8d..7f080f5c7def 100644
--- a/arch/x86/include/asm/io_bitmap.h
+++ b/arch/x86/include/asm/io_bitmap.h
@@ -19,12 +19,28 @@ struct task_struct;
void io_bitmap_share(struct task_struct *tsk);
void io_bitmap_exit(struct task_struct *tsk);
+static inline void native_tss_invalidate_io_bitmap(void)
+{
+ /*
+ * Invalidate the I/O bitmap by moving io_bitmap_base outside the
+ * TSS limit so any subsequent I/O access from user space will
+ * trigger a #GP.
+ *
+ * This is correct even when VMEXIT rewrites the TSS limit
+ * to 0x67 as the only requirement is that the base points
+ * outside the limit.
+ */
+ this_cpu_write(cpu_tss_rw.x86_tss.io_bitmap_base,
+ IO_BITMAP_OFFSET_INVALID);
+}
+
void native_tss_update_io_bitmap(void);
#ifdef CONFIG_PARAVIRT_XXL
#include <asm/paravirt.h>
#else
#define tss_update_io_bitmap native_tss_update_io_bitmap
+#define tss_invalidate_io_bitmap native_tss_invalidate_io_bitmap
#endif
#else