VMX: flush cache when vmentry back to UC guest
authorLiu Jinsong <jinsong.liu@intel.com>
Wed, 6 Nov 2013 09:13:20 +0000 (10:13 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 6 Nov 2013 09:13:20 +0000 (10:13 +0100)
commit86d60e855fe118df0dbdf67b67b1a0ec8fdb9f0d
tree0aea627f267d06c3f5eee215953d84e2714fc5f0
parent62652c00efa55fb45374bcc92f7d96fc411aebb2
VMX: flush cache when vmentry back to UC guest

This patch flush cache when vmentry back to UC guest, to prevent
cache polluted by hypervisor access guest memory during UC mode.

The elegant way to do this is, simply add wbinvd just before vmentry.
However, currently wbinvd before vmentry will mysteriously trigger
lapic timer interrupt storm, hung booting stage for 10s ~ 60s. We still
didn't dig out the root cause of interrupt storm, so currently this
patch add flag indicating hypervisor access UC guest memory to prevent
interrupt storm -- though it still leaves aspects un-addressed, i.e.
speculative reads, and multi-vCPU issues, etc.

Whenever the interrupt storm got root caused and fixed, the protection
flag can be removed -- that would be final clean and elegant approach
dealing with cache flushing before vmentry.

This is CVE-2013-2212 / XSA-60.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/vcpu.h