diff options
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 892ffc603ff9..9cafbb499813 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -1983,6 +1983,8 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *sptep, | |||
1983 | 1983 | ||
1984 | if (host_writable) | 1984 | if (host_writable) |
1985 | spte |= SPTE_HOST_WRITEABLE; | 1985 | spte |= SPTE_HOST_WRITEABLE; |
1986 | else | ||
1987 | pte_access &= ~ACC_WRITE_MASK; | ||
1986 | 1988 | ||
1987 | spte |= (u64)pfn << PAGE_SHIFT; | 1989 | spte |= (u64)pfn << PAGE_SHIFT; |
1988 | 1990 | ||
@@ -2222,8 +2224,6 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write, | |||
2222 | if (iterator.level == level) { | 2224 | if (iterator.level == level) { |
2223 | unsigned pte_access = ACC_ALL; | 2225 | unsigned pte_access = ACC_ALL; |
2224 | 2226 | ||
2225 | if (!map_writable) | ||
2226 | pte_access &= ~ACC_WRITE_MASK; | ||
2227 | mmu_set_spte(vcpu, iterator.sptep, ACC_ALL, pte_access, | 2227 | mmu_set_spte(vcpu, iterator.sptep, ACC_ALL, pte_access, |
2228 | 0, write, 1, &pt_write, | 2228 | 0, write, 1, &pt_write, |
2229 | level, gfn, pfn, prefault, map_writable); | 2229 | level, gfn, pfn, prefault, map_writable); |