aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/paging_tmpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/paging_tmpl.h')
-rw-r--r--arch/x86/kvm/paging_tmpl.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 2bdd843ad63f..a83ff3794055 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -224,9 +224,7 @@ walk:
224 is_cpuid_PSE36()) 224 is_cpuid_PSE36())
225 gfn += pse36_gfn_delta(pte); 225 gfn += pse36_gfn_delta(pte);
226 226
227 access |= write_fault ? PFERR_WRITE_MASK : 0; 227 access |= write_fault | fetch_fault | user_fault;
228 access |= fetch_fault ? PFERR_FETCH_MASK : 0;
229 access |= user_fault ? PFERR_USER_MASK : 0;
230 228
231 real_gpa = mmu->translate_gpa(vcpu, gfn_to_gpa(gfn), 229 real_gpa = mmu->translate_gpa(vcpu, gfn_to_gpa(gfn),
232 access); 230 access);
@@ -268,10 +266,9 @@ error:
268 walker->error_code = 0; 266 walker->error_code = 0;
269 if (present) 267 if (present)
270 walker->error_code |= PFERR_PRESENT_MASK; 268 walker->error_code |= PFERR_PRESENT_MASK;
271 if (write_fault) 269
272 walker->error_code |= PFERR_WRITE_MASK; 270 walker->error_code |= write_fault | user_fault;
273 if (user_fault) 271
274 walker->error_code |= PFERR_USER_MASK;
275 if (fetch_fault && mmu->nx) 272 if (fetch_fault && mmu->nx)
276 walker->error_code |= PFERR_FETCH_MASK; 273 walker->error_code |= PFERR_FETCH_MASK;
277 if (rsvd_fault) 274 if (rsvd_fault)
@@ -673,9 +670,9 @@ static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t vaddr, u32 access,
673 int r; 670 int r;
674 671
675 r = FNAME(walk_addr)(&walker, vcpu, vaddr, 672 r = FNAME(walk_addr)(&walker, vcpu, vaddr,
676 !!(access & PFERR_WRITE_MASK), 673 access & PFERR_WRITE_MASK,
677 !!(access & PFERR_USER_MASK), 674 access & PFERR_USER_MASK,
678 !!(access & PFERR_FETCH_MASK)); 675 access & PFERR_FETCH_MASK);
679 676
680 if (r) { 677 if (r) {
681 gpa = gfn_to_gpa(walker.gfn); 678 gpa = gfn_to_gpa(walker.gfn);