diff options
author | Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> | 2013-02-05 02:28:02 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2013-02-06 19:42:09 -0500 |
commit | 24db2734ad8123b6858ca98d690483ecdcceebb5 (patch) | |
tree | 702ca7b1dbd01e4e3feb33e2563f36c9fce6d7d0 /arch/x86 | |
parent | f761620377ebc791afba7ded078947d2116f48ce (diff) |
KVM: MMU: cleanup __direct_map
Use link_shadow_page to link the sp to the spte in __direct_map
Reviewed-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/mmu.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index e956e9bed294..1cda1f332654 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -1947,9 +1947,9 @@ static void link_shadow_page(u64 *sptep, struct kvm_mmu_page *sp) | |||
1947 | { | 1947 | { |
1948 | u64 spte; | 1948 | u64 spte; |
1949 | 1949 | ||
1950 | spte = __pa(sp->spt) | 1950 | spte = __pa(sp->spt) | PT_PRESENT_MASK | PT_WRITABLE_MASK | |
1951 | | PT_PRESENT_MASK | PT_ACCESSED_MASK | 1951 | shadow_user_mask | shadow_x_mask | shadow_accessed_mask; |
1952 | | PT_WRITABLE_MASK | PT_USER_MASK; | 1952 | |
1953 | mmu_spte_set(sptep, spte); | 1953 | mmu_spte_set(sptep, spte); |
1954 | } | 1954 | } |
1955 | 1955 | ||
@@ -2592,11 +2592,7 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write, | |||
2592 | iterator.level - 1, | 2592 | iterator.level - 1, |
2593 | 1, ACC_ALL, iterator.sptep); | 2593 | 1, ACC_ALL, iterator.sptep); |
2594 | 2594 | ||
2595 | mmu_spte_set(iterator.sptep, | 2595 | link_shadow_page(iterator.sptep, sp); |
2596 | __pa(sp->spt) | ||
2597 | | PT_PRESENT_MASK | PT_WRITABLE_MASK | ||
2598 | | shadow_user_mask | shadow_x_mask | ||
2599 | | shadow_accessed_mask); | ||
2600 | } | 2596 | } |
2601 | } | 2597 | } |
2602 | return emulate; | 2598 | return emulate; |