android_kernel_motorola_sm6225/arch/x86
Avi Kivity aa67f6096c KVM: VMX: Fix ds/es corruption on i386 with preemption
Commit b2da15ac26 ("KVM: VMX: Optimize %ds, %es reload") broke i386
in the following scenario:

  vcpu_load
  ...
  vmx_save_host_state
  vmx_vcpu_run
  (ds.rpl, es.rpl cleared by hardware)

  interrupt
    push ds, es  # pushes bad ds, es
    schedule
      vmx_vcpu_put
        vmx_load_host_state
          reload ds, es (with __USER_DS)
    pop ds, es  # of other thread's stack
    iret
  # other thread runs
  interrupt
    push ds, es
    schedule  # back in vcpu thread
    pop ds, es  # now with rpl=0
    iret
  ...
  vcpu_put
  resume_userspace
  iret  # clears ds, es due to mismatched rpl

(instead of resume_userspace, we might return with SYSEXIT and then
take an exception; when the exception IRETs we end up with cleared
ds, es)

Fix by avoiding the optimization on i386 and reloading ds, es on the
lightweight exit path.

Reported-by: Chris Clayron <chris2553@googlemail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2012-08-01 20:23:57 -03:00
..
boot x86, efi stub: Add .reloc section back into image 2012-06-07 09:52:33 -07:00
configs
crypto crypto: aesni-intel - fix unaligned cbc decrypt for x86-32 2012-05-31 20:53:22 +10:00
ia32 x86, compat: Use test_thread_flag(TIF_IA32) in compat signal delivery 2012-06-14 18:16:04 -07:00
include/asm IOMMU Updates for Linux v3.6-rc1 2012-07-24 16:24:11 -07:00
kernel IOMMU Updates for Linux v3.6-rc1 2012-07-24 16:24:11 -07:00
kvm KVM: VMX: Fix ds/es corruption on i386 with preemption 2012-08-01 20:23:57 -03:00
lguest
lib Merge branch 'x86/cpu' into perf/core 2012-07-05 21:12:11 +02:00
math-emu
mm x86/mm: Mark free_initrd_mem() as __init 2012-06-20 14:33:47 +02:00
net x86 bpf_jit: support BPF_S_ANC_ALU_XOR_X instruction 2012-06-06 09:42:44 -07:00
oprofile perf/x86/amd: Unify AMD's generic and family 15h pmus 2012-07-05 21:19:41 +02:00
pci Merge branch 'pci/myron-pcibios_setup' into next 2012-07-05 15:31:05 -06:00
platform Power management updates for 3.6 2012-07-22 13:36:52 -07:00
power
realmode x86-64, reboot: Be more paranoid in 64-bit reboot=bios 2012-06-21 10:25:03 -07:00
syscalls syscalls, x86: add __NR_kcmp syscall 2012-05-31 17:49:32 -07:00
tools x86/decoder: Fix bsr/bsf/jmpe decoding with operand-size prefix 2012-06-06 08:54:18 +02:00
um x86, um: Correct syscall table type attributes breaking gcc 4.8 2012-06-09 12:51:09 -07:00
vdso x86, cpu: Rename checking_wrmsrl() to wrmsrl_safe() 2012-06-07 13:32:04 -07:00
video x86: Use vga_default_device() when determining whether an fb is primary 2012-04-24 09:50:17 +01:00
xen Features: 2012-07-24 13:14:03 -07:00
.gitignore
Kbuild x86, realmode: realmode.bin infrastructure 2012-05-08 11:41:48 -07:00
Kconfig x86, efi: Add EFI boot stub documentation 2012-06-01 09:11:41 -07:00
Kconfig.cpu
Kconfig.debug
Makefile x86-64, gcc: Use -mpreferred-stack-boundary=3 if supported 2012-06-23 19:25:22 -07:00
Makefile.um
Makefile_32.cpu