Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1665773
| From | Brian Gerst <brgerst@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/3] x86-32: Simplify IOPL switch check |
| Date | 2017-06-14 14:50 +0200 |
| Message-ID | <tSfUe-5dU-31@gated-at.bofh.it> (permalink) |
| References | <tSfUd-5dU-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Remove the get_kernel_rpl() call from the test for switching IOPL. Instead
make set_iopl_mask() a no-op when Xen is running in supervisor mode.
Signed-off-by: Brian Gerst <brgerst@gmail.com>
---
arch/x86/kernel/process_32.c | 2 +-
arch/x86/xen/enlighten_pv.c | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index ffeae81..b2d1f7c 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -263,7 +263,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
* is running virtualized at a non-zero CPL, the popf will
* not restore flags, so it must be done in a separate step.
*/
- if (get_kernel_rpl() && unlikely(prev->iopl != next->iopl))
+ if (unlikely(prev->iopl != next->iopl))
set_iopl_mask(next->iopl);
/*
diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index f33eef4..05257c0 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -1350,8 +1350,10 @@ asmlinkage __visible void __init xen_start_kernel(void)
#ifdef CONFIG_X86_32
pv_info.kernel_rpl = 1;
- if (xen_feature(XENFEAT_supervisor_mode_kernel))
+ if (xen_feature(XENFEAT_supervisor_mode_kernel)) {
pv_info.kernel_rpl = 0;
+ pv_cpu_ops.set_iopl_mask = paravirt_nop;
+ }
#else
pv_info.kernel_rpl = 0;
#endif
--
2.9.4
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 2/3] x86-32: Simplify IOPL switch check Brian Gerst <brgerst@gmail.com> - 2017-06-14 14:50 +0200
csiph-web