From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH 1/3] Implement emulator_write_phys() Date: Mon, 27 Aug 2007 12:23:39 -0500 Message-ID: <1188235419.6364.2.camel@squirrel> References: <11882278064002-git-send-email-aliguori@us.ibm.com> <1188227808405-git-send-email-aliguori@us.ibm.com> <46D2F1B7.70604@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org To: Avi Kivity Return-path: In-Reply-To: <46D2F1B7.70604@qumranet.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Mon, 2007-08-27 at 18:45 +0300, Avi Kivity wrote: > Anthony Liguori wrote: > > Since a hypercall may span two pages and is a gva, we need a function to write > > to a gva that may span multiple pages. emulator_write_phys() seems like the > > logical choice for this. > > > > @@ -962,8 +962,35 @@ static int emulator_write_std(unsigned long addr, > > unsigned int bytes, > > struct kvm_vcpu *vcpu > > I think that emulator_write_emulated(), except for being awkwardly > named, should do the job. We have enough APIs. > > But! We may not overwrite the hypercall instruction while a vcpu may be > executing, since there's no atomicity guarantee for code fetch. We have > to to be out of guest mode while writing that insn. Hrm, good catch. How can we get out of guest mode given SMP guest support? Regards, Anthony Liguori > >