diff options
Diffstat (limited to 'drivers/kvm/mmu.c')
-rw-r--r-- | drivers/kvm/mmu.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index ba813f49f8aa..ceae25bfd4b5 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
@@ -752,7 +752,8 @@ static inline void set_pte_common(struct kvm_vcpu *vcpu, | |||
752 | u64 *shadow_pte, | 752 | u64 *shadow_pte, |
753 | gpa_t gaddr, | 753 | gpa_t gaddr, |
754 | int dirty, | 754 | int dirty, |
755 | u64 access_bits) | 755 | u64 access_bits, |
756 | gfn_t gfn) | ||
756 | { | 757 | { |
757 | hpa_t paddr; | 758 | hpa_t paddr; |
758 | 759 | ||
@@ -779,10 +780,10 @@ static inline void set_pte_common(struct kvm_vcpu *vcpu, | |||
779 | if (access_bits & PT_WRITABLE_MASK) { | 780 | if (access_bits & PT_WRITABLE_MASK) { |
780 | struct kvm_mmu_page *shadow; | 781 | struct kvm_mmu_page *shadow; |
781 | 782 | ||
782 | shadow = kvm_mmu_lookup_page(vcpu, gaddr >> PAGE_SHIFT); | 783 | shadow = kvm_mmu_lookup_page(vcpu, gfn); |
783 | if (shadow) { | 784 | if (shadow) { |
784 | pgprintk("%s: found shadow page for %lx, marking ro\n", | 785 | pgprintk("%s: found shadow page for %lx, marking ro\n", |
785 | __FUNCTION__, (gfn_t)(gaddr >> PAGE_SHIFT)); | 786 | __FUNCTION__, gfn); |
786 | access_bits &= ~PT_WRITABLE_MASK; | 787 | access_bits &= ~PT_WRITABLE_MASK; |
787 | *shadow_pte &= ~PT_WRITABLE_MASK; | 788 | *shadow_pte &= ~PT_WRITABLE_MASK; |
788 | } | 789 | } |