Browse Source

KVM: MMU: Only indicate a fetch fault in page fault error code if nx is enabled

Bit 4 of the page fault error code is set only if EFER.NX is set.

Reviewed-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Avi Kivity 15 years ago
parent
commit
b0eeec29fe
1 changed files with 1 additions and 1 deletions
  1. 1 1
      arch/x86/kvm/paging_tmpl.h

+ 1 - 1
arch/x86/kvm/paging_tmpl.h

@@ -245,7 +245,7 @@ err:
 		walker->error_code |= PFERR_WRITE_MASK;
 	if (user_fault)
 		walker->error_code |= PFERR_USER_MASK;
-	if (fetch_fault)
+	if (fetch_fault && is_nx(vcpu))
 		walker->error_code |= PFERR_FETCH_MASK;
 	if (rsvd_fault)
 		walker->error_code |= PFERR_RSVD_MASK;