Commit b0eeec29 authored by Avi Kivity's avatar Avi Kivity

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: default avatarXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 5d55f299
...@@ -245,7 +245,7 @@ static int FNAME(walk_addr)(struct guest_walker *walker, ...@@ -245,7 +245,7 @@ static int FNAME(walk_addr)(struct guest_walker *walker,
walker->error_code |= PFERR_WRITE_MASK; walker->error_code |= PFERR_WRITE_MASK;
if (user_fault) if (user_fault)
walker->error_code |= PFERR_USER_MASK; walker->error_code |= PFERR_USER_MASK;
if (fetch_fault) if (fetch_fault && is_nx(vcpu))
walker->error_code |= PFERR_FETCH_MASK; walker->error_code |= PFERR_FETCH_MASK;
if (rsvd_fault) if (rsvd_fault)
walker->error_code |= PFERR_RSVD_MASK; walker->error_code |= PFERR_RSVD_MASK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment