public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Why so many vm exits caused by ept violation
@ 2010-11-08 12:15 lidong chen
  2010-11-08 14:01 ` Avi Kivity
  0 siblings, 1 reply; 18+ messages in thread
From: lidong chen @ 2010-11-08 12:15 UTC (permalink / raw)
  To: kvm

I run my application both on xen and kvm, and I found the performance
on kvm is worse than xen.

kvm: 2.6.32-60.el6.x86_64 redhat 6 bate 2
xen: xen3.4.2

then i stat the vm exit reason, and i found the ept violation reason,
kvm is much more than xen. the static result is :

(XEN) 100000 times on cpu 0,
reason, times
0, 388
1, 8636
7, 1902
12, 18292
18, 6065
28, 8474
30, 16590
44, 39653

(KVM) 100000 times on cpu 0,
reason, times
0, 998
1, 7115
7, 3335
12, 1953
28, 1988
30, 22324
44, 20224
48, 42063

by used xen, it didn't have ept violation, because my application
first malloc all memory,and initialize it. so i think kvm is also
didn't need vm exits by ept violation .

the exit_qualification of ept violation  is 181 or 182, i found the
code run abnormality while deal with ept violation, the error happed
because the return of slot is NULL

unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn)
{
	struct kvm_memory_slot *slot;

	gfn = unalias_gfn_instantiation(kvm, gfn);
	slot = gfn_to_memslot_unaliased(kvm, gfn);

                /* the error happed at this , the return of slot is NULL */

	if (!slot || slot->flags & KVM_MEMSLOT_INVALID)
		return bad_hva();
	return (slot->userspace_addr + (gfn - slot->base_gfn) * PAGE_SIZE);
}

then i printk the gfa below:

__ratelimit: 387 callbacks suppressed
error gpa is 4273995776
error gpa is 4273995776
error gpa is 4273995776
error gpa is 4273995776
error gpa is 4273995776
error gpa is 782336
error gpa is 782336
error gpa is 782336
error gpa is 782336
error gpa is 782336
__ratelimit: 387 callbacks suppressed
error gpa is 782336
error gpa is 782336
error gpa is 782336
error gpa is 782336
error gpa is 782336
error gpa is 782336
error gpa is 782336
error gpa is 782336
error gpa is 782336
error gpa is 782336


why access this address cause vm exit in kvm, but didn't cause vm exit in xen.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-11-16 13:35 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-08 12:15 Why so many vm exits caused by ept violation lidong chen
2010-11-08 14:01 ` Avi Kivity
2010-11-08 16:29   ` lidong chen
2010-11-09  7:37     ` lidong chen
2010-11-09  7:45       ` Gleb Natapov
2010-11-09  9:04         ` lidong chen
2010-11-09  9:27           ` Gleb Natapov
2010-11-09 10:24             ` lidong chen
2010-11-09 11:24               ` Gleb Natapov
2010-11-10  7:09                 ` lidong chen
2010-11-10  8:26                   ` Avi Kivity
2010-11-15  4:34                     ` lidong chen
2010-11-15  6:40                       ` lidong chen
2010-11-15  7:24                         ` lidong chen
2010-11-15  9:09                           ` Avi Kivity
2010-11-15 12:39                             ` lidong chen
2010-11-15 12:44                               ` lidong chen
2010-11-16 13:35                                 ` lidong chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox