mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
bitkeeper revision 1.1159.187.27 (41a99261iejadhs-BVt7TOiimzafww)
Fix IOPL handling.
1. Both Linux 2.4 and 2.6 were not correctly setting IOPL during context
switch (they sent a bogus dom0_op with a bad version number).
2. The switch_vm86 hypercall was corrupting EFLAGS and setting IOPL==0.
This commit is contained in:
1 parent
93b7067dd7
commit
e97d12ad95
3 files changed
+8
-6
No files matched your search
@@ -344,6 +344,7 @@ void fastcall __switch_to(struct task_struct *prev_p, struct task_struct *next_p
|
||||
op.cmd = DOM0_IOPL;
|
||||
op.u.iopl.domain = DOMID_SELF;
|
||||
op.u.iopl.iopl = next->io_pl;
|
||||
op.interface_version = DOM0_INTERFACE_VERSION;
|
||||
queue_multicall1(__HYPERVISOR_dom0_op, (unsigned long)&op);
|
||||
}
|
||||
|
||||
|
||||
@@ -534,6 +534,7 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
|
||||
op.cmd = DOM0_IOPL;
|
||||
op.u.iopl.domain = DOMID_SELF;
|
||||
op.u.iopl.iopl = next->io_pl;
|
||||
op.interface_version = DOM0_INTERFACE_VERSION;
|
||||
queue_multicall1(__HYPERVISOR_dom0_op, (unsigned long)&op);
|
||||
}
|
||||
|
||||
|
||||
@@ -585,8 +585,8 @@ do_switch_vm86:
|
||||
# Discard the return address
|
||||
addl $4,%esp
|
||||
|
||||
movl XREGS_eflags(%esp),%ecx
|
||||
|
||||
movl XREGS_eflags(%esp),%edx
|
||||
|
||||
# GS:ESI == Ring-1 stack activation
|
||||
movl XREGS_esp(%esp),%esi
|
||||
VFLT1: movl XREGS_ss(%esp),%gs
|
||||
@@ -608,11 +608,11 @@ VFLT3: movl %gs:(%esi),%eax
|
||||
|
||||
# Fix up EFLAGS
|
||||
andl $~X86_EFLAGS_IOPL,XREGS_eflags(%esp)
|
||||
andl $X86_EFLAGS_IOPL,%ecx # Ignore attempts to change EFLAGS.IOPL
|
||||
andl $X86_EFLAGS_IOPL,%edx # Ignore attempts to change EFLAGS.IOPL
|
||||
jnz 1f
|
||||
orl $X86_EFLAGS_IF,%ecx # EFLAGS.IOPL=0 => no messing with EFLAGS.IF
|
||||
1: orl $X86_EFLAGS_VM,%ecx # Force EFLAGS.VM
|
||||
orl %ecx,XREGS_eflags(%esp)
|
||||
orl $X86_EFLAGS_IF,%edx # EFLAGS.IOPL=0 => no messing with EFLAGS.IF
|
||||
1: orl $X86_EFLAGS_VM,%edx # Force EFLAGS.VM
|
||||
orl %edx,XREGS_eflags(%esp)
|
||||
|
||||
jmp test_all_events
|
||||
|
||||
|
||||