From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 10/27] nVMX: Implement VMCLEAR Date: Sun, 17 Oct 2010 15:27:46 +0200 Message-ID: <4CBAF9D2.20100@redhat.com> References: <1287309814-nyh@il.ibm.com> <201010171008.o9HA8g4E029408@rice.haifa.ibm.com> <4CBAF4B2.5000505@redhat.com> <20101017132522.GD14069@fermat.math.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, gleb@redhat.com To: "Nadav Har'El" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:10412 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756613Ab0JQN1x (ORCPT ); Sun, 17 Oct 2010 09:27:53 -0400 In-Reply-To: <20101017132522.GD14069@fermat.math.technion.ac.il> Sender: kvm-owner@vger.kernel.org List-ID: On 10/17/2010 03:25 PM, Nadav Har'El wrote: > On Sun, Oct 17, 2010, Avi Kivity wrote about "Re: [PATCH 10/27] nVMX: Implement VMCLEAR": > > >+ vmcs12 = kmap(page); > > > > kmap_atomic() please (better, kvm_write_guest(), but can defer that for > > later) > > Sorry about my ignorance, but why is kmap_atomic() better here than kmap()? > While handling an exit (caused by a guest running VMCLEAR instruction), we > aren't in atomic context, aren't we? kmap() is unloved since it is deadlock-prone in some circumstances, and also much slower than kmap_atomic(), since it needs global tlb synchronization. > If I use kmap_atomic() here I'll need to kunmap_atomic() below which will > break the newly combined kunmap& nested_release_page function ;-) > > > >+ vmcs12->launch_state = 0; > > >+ kunmap(page); > > >+ nested_release_page(page); > Is something preventing you from changing all kmap()s to kmap_atomic()s (like guest memory access in the mapped section)? -- error compiling committee.c: too many arguments to function