KVM: Enable MTRR for EPT

Previous thread: KVM: Add local get_mtrr_type() to support MTRR by Linux Kernel Mailing List on Friday, January 2, 2009 - 1:59 pm. (1 message)

Next thread: KVM: Clean up kvm_x86_emulate.h by Linux Kernel Mailing List on Friday, January 2, 2009 - 1:59 pm. (1 message)
From: Linux Kernel Mailing List
Date: Friday, January 2, 2009 - 1:59 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=64d4d5...
Commit:     64d4d521757117aa5c1cfe79d3baa6cf57703f81
Parent:     74be52e3e6285fc6e872a2a7baea544106f399ea
Author:     Sheng Yang <sheng@linux.intel.com>
AuthorDate: Thu Oct 9 16:01:57 2008 +0800
Committer:  Avi Kivity <avi@redhat.com>
CommitDate: Wed Dec 31 16:51:45 2008 +0200

    KVM: Enable MTRR for EPT
    
    The effective memory type of EPT is the mixture of MSR_IA32_CR_PAT and memory
    type field of EPT entry.
    
    Signed-off-by: Sheng Yang <sheng@linux.intel.com>
    Signed-off-by: Avi Kivity <avi@redhat.com>
---
 arch/x86/include/asm/kvm_host.h |    3 ++-
 arch/x86/kvm/mmu.c              |   11 ++++++++++-
 arch/x86/kvm/svm.c              |    6 ++++++
 arch/x86/kvm/vmx.c              |   10 ++++++++--
 arch/x86/kvm/x86.c              |    2 +-
 5 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 8082e87..93040b5 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -483,6 +483,7 @@ struct kvm_x86_ops {
 
 	int (*set_tss_addr)(struct kvm *kvm, unsigned int addr);
 	int (*get_tdp_level)(void);
+	int (*get_mt_mask_shift)(void);
 };
 
 extern struct kvm_x86_ops *kvm_x86_ops;
@@ -496,7 +497,7 @@ int kvm_mmu_setup(struct kvm_vcpu *vcpu);
 void kvm_mmu_set_nonpresent_ptes(u64 trap_pte, u64 notrap_pte);
 void kvm_mmu_set_base_ptes(u64 base_pte);
 void kvm_mmu_set_mask_ptes(u64 user_mask, u64 accessed_mask,
-		u64 dirty_mask, u64 nx_mask, u64 x_mask);
+		u64 dirty_mask, u64 nx_mask, u64 x_mask, u64 mt_mask);
 
 int kvm_mmu_reset_context(struct kvm_vcpu *vcpu);
 void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot);
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index ac2304f..09d05f5 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -168,6 +168,7 @@ static u64 __read_mostly ...
Previous thread: KVM: Add local get_mtrr_type() to support MTRR by Linux Kernel Mailing List on Friday, January 2, 2009 - 1:59 pm. (1 message)

Next thread: KVM: Clean up kvm_x86_emulate.h by Linux Kernel Mailing List on Friday, January 2, 2009 - 1:59 pm. (1 message)