]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: Optimize %ds, %es reload
authorAvi Kivity <avi@redhat.com>
Sun, 13 May 2012 16:53:24 +0000 (19:53 +0300)
committerMarcelo Tosatti <mtosatti@redhat.com>
Wed, 16 May 2012 19:03:19 +0000 (16:03 -0300)
commitaaabbb09c75a97f3ad16f1157d818b933c9b3f38
tree7cf2f30e20976877b7bcef1b76a7441f474f062d
parentec2f9e30e130d6261fd2b05fec7ee9d9dd9998ec
KVM: VMX: Optimize %ds, %es reload

On x86_64, we can defer %ds and %es reload to the heavyweight context switch,
since nothing in the lightweight paths uses the host %ds or %es (they are
ignored by the processor).  Furthermore we can avoid the load if the segments
are null, by letting the hardware load the null segments for us.  This is the
expected case.

On i386, we could avoid the reload entirely, since the entry.S paths take care
of reload, except for the SYSEXIT path which leaves %ds and %es set to __USER_DS.
So we set them to the same values as well.

Saves about 70 cycles out of 1600 (around 4%; noisy measurements).

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/vmx.c