* [Qemu-devel] INVLPG and IPI emulation in KVM
@ 2011-11-13 12:27 Xin Tong
2011-11-13 12:44 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Xin Tong @ 2011-11-13 12:27 UTC (permalink / raw)
To: qemu-devel
I am investigating how INVLPG is emulated in kvm. 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 ? how does the guest
handle the requests ?
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.
Thanks
Xin
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] INVLPG and IPI emulation in KVM
2011-11-13 12:27 [Qemu-devel] INVLPG and IPI emulation in KVM Xin Tong
@ 2011-11-13 12:44 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2011-11-13 12:44 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-13 12:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-13 12:27 [Qemu-devel] INVLPG and IPI emulation in KVM Xin Tong
2011-11-13 12:44 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).