From: Xiao Guangrong Date: Mon, 15 Jun 2015 08:55:31 +0000 (+0800) Subject: KVM: MTRR: sort variable MTRRs X-Git-Tag: omap-for-v4.3/legacy-v2-signed~167^2~14 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19efffa244071ccd0385b240d03adb38feaab04e;p=pandora-kernel.git KVM: MTRR: sort variable MTRRs Sort all valid variable MTRRs based on its base address, it will help us to check a range to see if it's fully contained in variable MTRRs Signed-off-by: Xiao Guangrong [Fix list insertion sort, simplify var_mtrr_range_is_valid to just test the V bit. - Paolo] Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index f73554874845..f2d60cce7595 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -345,12 +345,15 @@ enum { struct kvm_mtrr_range { u64 base; u64 mask; + struct list_head node; }; struct kvm_mtrr { struct kvm_mtrr_range var_ranges[KVM_NR_VAR_MTRR]; mtrr_type fixed_ranges[KVM_NR_FIXED_MTRR_REGION]; u64 deftype; + + struct list_head head; }; struct kvm_vcpu_arch { Reading git-diff-tree failed