linux/arch
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
..
alpha Merge branch 'pci/myron-pcibios_setup' into next 2012-07-05 15:31:05 -06:00
arm The common clk framework changes for 3.6 include a small number of core 2012-07-24 16:40:57 -07:00
avr32 fixups for signal breakage 2012-06-04 17:47:34 -04:00
blackfin Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-07-24 10:01:50 -07:00
c6x Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-07-24 10:01:50 -07:00
cris cris/PCI: factor out pcibios_setup() 2012-07-05 15:09:07 -06:00
frv frv/PCI: move fixup hooks from __init to __devinit 2012-06-12 09:10:55 -06:00
h8300 h8300/uaccess: add mising __clear_user() 2012-07-11 16:04:46 -07:00
hexagon hexagon: SMP: Remove call to ipi_call_lock()/ipi_call_unlock() 2012-06-05 17:27:11 +02:00
ia64 IOMMU Updates for Linux v3.6-rc1 2012-07-24 16:24:11 -07:00
m32r Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-07-22 11:22:15 -07:00
m68k Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2012-07-24 17:20:51 -07:00
microblaze PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
mips PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
mn10300 Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-07-22 11:22:15 -07:00
openrisc new helper: signal_delivered() 2012-06-01 12:58:52 -04:00
parisc PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
powerpc PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
s390 KVM updates for the 3.6 merge window 2012-07-24 12:01:20 -07:00
score new helper: signal_delivered() 2012-06-01 12:58:52 -04:00
sh Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-07-24 17:12:54 -07:00
sparc PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
tile PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
um Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-07-19 11:17:30 -07:00
unicore32 PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
x86 KVM: VMX: Fix ds/es corruption on i386 with preemption 2012-08-01 20:23:57 -03:00
xtensa PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
.gitignore
Kconfig Merge branch 'for-linus' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping 2012-05-25 09:18:59 -07:00