From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPZQX-0006yz-6p for qemu-devel@nongnu.org; Sun, 13 Nov 2011 07:44:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPZQW-0002WZ-8p for qemu-devel@nongnu.org; Sun, 13 Nov 2011 07:44:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPZQW-0002WG-1E for qemu-devel@nongnu.org; Sun, 13 Nov 2011 07:44:48 -0500 Message-ID: <4EBFBBB9.60106@redhat.com> Date: Sun, 13 Nov 2011 14:44:41 +0200 From: Avi Kivity MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] INVLPG and IPI emulation in KVM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Xin Tong Cc: qemu-devel , KVM list On 11/13/2011 02:27 PM, Xin Tong wrote: > I am investigating how INVLPG is emulated in kvm. You're on the wrong list. > It turns out that it calls > > kvm_mmu_invlpg > kvm_mmu_flush_tlb > kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu); > > and the kvm_make_request set the vcpu->requests bit to high, when the > guest os resumes, it handles the bit. I have 2 questions > > > 1. How does the make_request mechanism work ? See vcpu_enter_guest(). > how does the guest > handle the requests ? The guest never sees them, this is all internal to kvm. > 2. INVLPG invalidates a tlb entry, it is typically used when the page > table changes. However, an ipi is typically used to invalidate the tlb > entries in other processor cores, However, i can not find the > emulation code for IPI instruction. There is no IPI instruction, see lapic.c:apic_send_ipi(). -- error compiling committee.c: too many arguments to function