debuggers.hg

diff xen/arch/x86/x86_32/entry.S @ 3218:4580e96f30e1

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.
author kaf24@scramble.cl.cam.ac.uk
date Sun Nov 28 08:54:57 2004 +0000 (2004-11-28)
parents 861d3cdc1dc5
children ee14738f68ba f65b65977b19 d01d0f3f5ecc
line diff
     1.1 --- a/xen/arch/x86/x86_32/entry.S	Sat Nov 27 18:16:32 2004 +0000
     1.2 +++ b/xen/arch/x86/x86_32/entry.S	Sun Nov 28 08:54:57 2004 +0000
     1.3 @@ -585,8 +585,8 @@ do_switch_vm86:
     1.4          # Discard the return address
     1.5          addl $4,%esp
     1.6  
     1.7 -        movl XREGS_eflags(%esp),%ecx
     1.8 -                
     1.9 +        movl XREGS_eflags(%esp),%edx
    1.10 +
    1.11          # GS:ESI == Ring-1 stack activation
    1.12          movl XREGS_esp(%esp),%esi
    1.13  VFLT1:  movl XREGS_ss(%esp),%gs
    1.14 @@ -608,11 +608,11 @@ VFLT3:  movl %gs:(%esi),%eax
    1.15  
    1.16          # Fix up EFLAGS
    1.17          andl $~X86_EFLAGS_IOPL,XREGS_eflags(%esp)
    1.18 -        andl $X86_EFLAGS_IOPL,%ecx # Ignore attempts to change EFLAGS.IOPL
    1.19 +        andl $X86_EFLAGS_IOPL,%edx # Ignore attempts to change EFLAGS.IOPL
    1.20          jnz  1f
    1.21 -        orl  $X86_EFLAGS_IF,%ecx   # EFLAGS.IOPL=0 => no messing with EFLAGS.IF
    1.22 -1:      orl  $X86_EFLAGS_VM,%ecx   # Force EFLAGS.VM
    1.23 -        orl  %ecx,XREGS_eflags(%esp)
    1.24 +        orl  $X86_EFLAGS_IF,%edx   # EFLAGS.IOPL=0 => no messing with EFLAGS.IF
    1.25 +1:      orl  $X86_EFLAGS_VM,%edx   # Force EFLAGS.VM
    1.26 +        orl  %edx,XREGS_eflags(%esp)
    1.27          
    1.28          jmp test_all_events
    1.29