Commit ed922739 authored by Maciej S. Szmigiero's avatar Maciej S. Szmigiero Committed by Paolo Bonzini
Browse files

KVM: Use interval tree to do fast hva lookup in memslots



The current memslots implementation only allows quick binary search by gfn,
quick lookup by hva is not possible - the implementation has to do a linear
scan of the whole memslots array, even though the operation being performed
might apply just to a single memslot.

This significantly hurts performance of per-hva operations with higher
memslot counts.

Since hva ranges can overlap between memslots an interval tree is needed
for tracking them.

[sean: handle interval tree updates in kvm_replace_memslot()]
Signed-off-by: default avatarMaciej S. Szmigiero <maciej.szmigiero@oracle.com>
Message-Id: <d66b9974becaa9839be9c4e1a5de97b177b4ac20.1638817640.git.maciej.szmigiero@oracle.com>
parent 26b8345a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ menuconfig KVM
	select HAVE_KVM_IRQ_BYPASS
	select HAVE_KVM_VCPU_RUN_PID_CHANGE
	select SCHED_INFO
	select INTERVAL_TREE
	help
	  Support hosting virtualized guest machines.

+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ config KVM
	select KVM_MMIO
	select MMU_NOTIFIER
	select SRCU
	select INTERVAL_TREE
	help
	  Support for hosting Guest kernels.

+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ config KVM
	select KVM_VFIO
	select IRQ_BYPASS_MANAGER
	select HAVE_KVM_IRQ_BYPASS
	select INTERVAL_TREE

config KVM_BOOK3S_HANDLER
	bool
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ config KVM
	select HAVE_KVM_NO_POLL
	select SRCU
	select KVM_VFIO
	select INTERVAL_TREE
	help
	  Support hosting paravirtualized guest machines using the SIE
	  virtualization capability on the mainframe. This should work
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ config KVM
	select KVM_GENERIC_DIRTYLOG_READ_PROTECT
	select KVM_VFIO
	select SRCU
	select INTERVAL_TREE
	select HAVE_KVM_PM_NOTIFIER if PM
	help
	  Support hosting fully virtualized guest machines using hardware
Loading