Commit a24ca997 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

x86/iopl: Remove legacy IOPL option



The IOPL emulation via the I/O bitmap is sufficient. Remove the legacy
cruft dealing with the (e)flags based IOPL mechanism.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: Juergen Gross <jgross@suse.com> (Paravirt and Xen parts)
Acked-by: default avatarAndy Lutomirski <luto@kernel.org>
parent c8137ace
Loading
Loading
Loading
Loading
+3 −20
Original line number Diff line number Diff line
@@ -1254,12 +1254,9 @@ config X86_VSYSCALL_EMULATION
	 Disabling this option saves about 7K of kernel size and
	 possibly 4K of additional runtime pagetable memory.

choice
	prompt "IOPL"
	default X86_IOPL_EMULATION

config X86_IOPL_EMULATION
	bool "IOPL Emulation"
	default y
	---help---
	  Legacy IOPL support is an overbroad mechanism which allows user
	  space aside of accessing all 65536 I/O ports also to disable
@@ -1269,22 +1266,8 @@ config X86_IOPL_EMULATION

	  The emulation restricts the functionality of the syscall to
	  only allowing the full range I/O port access, but prevents the
	  ability to disable interrupts from user space.

config X86_IOPL_LEGACY
	bool "IOPL Legacy"
	---help---
	Allow the full IOPL permissions, i.e. user space access to all
	65536 I/O ports and also the ability to disable interrupts, which
	is overbroad and can result in system lockups.

config X86_IOPL_NONE
	bool "IOPL None"
	---help---
	Disable the IOPL permission syscall. That's the safest option as
	no sane application should depend on this functionality.

endchoice
	  ability to disable interrupts from user space which would be
	  granted if the hardware IOPL mechanism would be used.

config TOSHIBA
	tristate "Toshiba Laptop support"
+0 −4
Original line number Diff line number Diff line
@@ -294,10 +294,6 @@ static inline void write_idt_entry(gate_desc *dt, int entry, const gate_desc *g)
{
	PVOP_VCALL3(cpu.write_idt_entry, dt, entry, g);
}
static inline void set_iopl_mask(unsigned mask)
{
	PVOP_VCALL1(cpu.set_iopl_mask, mask);
}

static inline void paravirt_activate_mm(struct mm_struct *prev,
					struct mm_struct *next)
+0 −2
Original line number Diff line number Diff line
@@ -140,8 +140,6 @@ struct pv_cpu_ops {

	void (*load_sp0)(unsigned long sp0);

	void (*set_iopl_mask)(unsigned mask);

	void (*wbinvd)(void);

	/* cpuid emulation, mostly so that caps bits can be disabled */
+3 −23
Original line number Diff line number Diff line
@@ -516,10 +516,10 @@ struct thread_struct {
	struct io_bitmap	*io_bitmap;

	/*
	 * IOPL. Priviledge level dependent I/O permission which includes
	 * user space CLI/STI when granted.
	 * IOPL. Priviledge level dependent I/O permission which is
	 * emulated via the I/O bitmap to prevent user space from disabling
	 * interrupts.
	 */
	unsigned long		iopl;
	unsigned long		iopl_emul;

	mm_segment_t		addr_limit;
@@ -552,25 +552,6 @@ static inline void arch_thread_struct_whitelist(unsigned long *offset,
 */
#define TS_COMPAT		0x0002	/* 32bit syscall active (64BIT)*/

/*
 * Set IOPL bits in EFLAGS from given mask
 */
static inline void native_set_iopl_mask(unsigned mask)
{
#ifdef CONFIG_X86_32
	unsigned int reg;

	asm volatile ("pushfl;"
		      "popl %0;"
		      "andl %1, %0;"
		      "orl %2, %0;"
		      "pushl %0;"
		      "popfl"
		      : "=&r" (reg)
		      : "i" (~X86_EFLAGS_IOPL), "r" (mask));
#endif
}

static inline void
native_load_sp0(unsigned long sp0)
{
@@ -610,7 +591,6 @@ static inline void load_sp0(unsigned long sp0)
	native_load_sp0(sp0);
}

#define set_iopl_mask native_set_iopl_mask
#endif /* CONFIG_PARAVIRT_XXL */

/* Free all resources held by a thread. */
+0 −2
Original line number Diff line number Diff line
@@ -62,6 +62,4 @@ void xen_arch_register_cpu(int num);
void xen_arch_unregister_cpu(int num);
#endif

extern void xen_set_iopl_mask(unsigned mask);

#endif /* _ASM_X86_XEN_HYPERVISOR_H */
Loading