From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: guest state leak into host Date: Sun, 13 May 2007 13:51:31 +0300 Message-ID: <4646EDB3.6030602@qumranet.com> References: <10EA09EFD8728347A513008B6B0DA77A016AB9E3@pdsmsx411.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: "Dong, Eddie" Return-path: In-Reply-To: <10EA09EFD8728347A513008B6B0DA77A016AB9E3-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Dong, Eddie wrote: > Avi: > Following commit mentioned guest state leaking into host, Can u > explain a bit? > In my understanding, as if control goes to vmx_vcpu_run, CPU > preemption is disabled, i.e. no rescheduling will happen (Guest > resheduling will only happen at IOCTL return to Qemu time or vcpu_put at > kvm_vcpu_ioctl_run). In this case, let machine FPU hold guest state > (Linux Kernel itself will not use FPU), and machine MSRs (SYSCALL_MASK, > LSTAR, K6_STAR, CSTAR, GS_BASE) hold for guest MSRs can avoid > save/restore and thus performance gain. But I might make some mistake. > Some exit handlers (even the #PF handler) can sleep sometimes. They call kvm_arch_ops->vcpu_put(), do some sleepy thing, then call kvm_arch_ops->vcpu_load(). The changes in the commit make sure that if vcpu_put() is called, the lightweight exit is converted to a heavyweight exit. Since such sleeps are rare, this is not expected to impact performance. See for example mmu_topup_memory_caches(). -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/