Skip to content
Commit 6bb69c9b authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

KVM: MMU: simplify last_pte_bitmap



Branch-free code is fun and everybody knows how much Avi loves it,
but last_pte_bitmap takes it a bit to the extreme.  Since the code
is simply doing a range check, like

	(level == 1 ||
	 ((gpte & PT_PAGE_SIZE_MASK) && level < N)

we can make it branch-free without storing the entire truth table;
it is enough to cache N.

Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 50c9e6f3
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment