Why so many vm exits caused by ept violation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux