From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: Question on shadow_invlpg return value handling. Date: Tue, 27 Mar 2007 08:32:25 +0000 Message-ID: <20070327083225.GA11216@york.uk.xensource.com> References: <604922.39574.qm@web8705.mail.in.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <604922.39574.qm@web8705.mail.in.yahoo.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: aditya shevalkar Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org At 10:21 +0530 on 27 Mar (1174990916), aditya shevalkar wrote: > Can anyone explain me where does this return values from sh_invlpg are used. > The comment is given below: > /* Called when the guest requests an invlpg. Returns 1 if the invlpg > * instruction should be issued on the hardware, or 0 if it's safe not > * to do so. */ > I have followed the following path of function call in my study of the function. > vmx_vmexit_do_invlpg(va) à shadow_invlpg(v, va) à sh_invlpg(struct vcpu *v, unsigned long va). The VMX (and SVM) code ignores the return code of shadow_invlpg at the moment, because they both flush the entire TLB on every VM entry anyway (AMD's hardware support for tagged TLBs is apparently not quite useable yet). arch/x86/mm.c, which handles PV guests, uses the return code correctly, e.g.: case MMUEXT_INVLPG_LOCAL: if ( !shadow_mode_enabled(d) || shadow_invlpg(v, op.arg1.linear_addr) != 0 ) local_flush_tlb_one(op.arg1.linear_addr); break; Cheers, Tim. -- Tim Deegan , XenSource UK Limited Registered office c/o EC2Y 5EB, UK; company number 05334508