From mboxrd@z Thu Jan 1 00:00:00 1970 From: jeet Subject: Re: Question on shadow_invlpg return value handling. Date: Tue, 27 Mar 2007 15:49:22 +0530 (IST) Message-ID: <255418.7451.qm@web8808.mail.in.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Tim Deegan , aditya shevalkar Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Hi Tim=0A=0AIf on VM entry TLB is flushed why we are handling instruction "= invlpg" in xen=0Acan't this be done by doing VMexit and VM entry as this wo= uld do flushing of TLB?=0A=0AIs this TLB flush done due to loading of guest= state (mov to cr3)?=0Aor =0AIs TLB flush on VM entry hardware feature or i= s implemented in Xen ?=0A=0Ajeet=0A=0A----- Original Message ----=0AFrom: T= im Deegan =0ATo: aditya shevalkar =0ACc: xen-devel@lists.xensource.com=0ASent: Tuesday, 27 March, 2= 007 2:02:25 PM=0ASubject: Re: [Xen-devel] Question on shadow_invlpg return = value handling.=0A=0AAt 10:21 +0530 on 27 Mar (1174990916), aditya shevalka= r wrote:=0A> Can anyone explain me where does this return values from sh_in= vlpg are used.=0A> The comment is given below:=0A> /* Called when the gues= t requests an invlpg. Returns 1 if the invlpg=0A> * instruction should be = issued on the hardware, or 0 if it's safe not=0A> * to do so. */=0A> I hav= e followed the following path of function call in my study of the function.= =0A> vmx_vmexit_do_invlpg(va) =E0 shadow_invlpg(v, va) =E0 sh_invlpg(struc= t vcpu *v, unsigned long va).=0A=0AThe VMX (and SVM) code ignores the retur= n code of shadow_invlpg at the=0Amoment, because they both flush the entire= TLB on every VM entry anyway=0A(AMD's hardware support for tagged TLBs is = apparently not quite useable=0Ayet).=0A=0Aarch/x86/mm.c, which handles PV g= uests, uses the return code correctly,=0Ae.g.:=0A=0A case MMUEXT_INVLPG_LO= CAL:=0A if ( !shadow_mode_enabled(d) =0A || shadow_invlpg(= v, op.arg1.linear_addr) !=3D 0 )=0A local_flush_tlb_one(op.arg1.l= inear_addr);=0A break;=0A=0ACheers,=0A=0ATim.=0A=0A-- =0ATim Deegan <= Tim.Deegan@xensource.com>, XenSource UK Limited=0ARegistered office c/o EC2= Y 5EB, UK; company number 05334508=0A=0A___________________________________= ____________=0AXen-devel mailing list=0AXen-devel@lists.xensource.com=0Ahtt= p://lists.xensource.com/xen-devel=0A=0A=0A=0A=0A=0A=09=09=0A_______________= ___________________________________________=0AYahoo! India Answers: Share w= hat you know. Learn something new=0Ahttp://in.answers.yahoo.com/