KVM: MMU: Only indicate a fetch fault in page fault error code if nx is enabled
authorAvi Kivity <[email protected]>
Tue, 6 Jul 2010 12:40:18 +0000 (15:40 +0300)
committerAvi Kivity <[email protected]>
Mon, 2 Aug 2010 03:40:29 +0000 (06:40 +0300)
Bit 4 of the page fault error code is set only if EFER.NX is set.

Reviewed-by: Xiao Guangrong <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
arch/x86/kvm/paging_tmpl.h

index 796a325c7e595fd705227f9c0f762e95a0072372..3a3f6d784d7947445187532561c71cb8b5acf247 100644 (file)
@@ -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;