Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80822
b: refs/heads/master
c: bedbe4e
h: refs/heads/master
v: v3
  • Loading branch information
Avi Kivity committed Jan 30, 2008
1 parent bdffe31 commit 4407c19
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d87a03aea43535a92efbb180e0ceac94d4bb5db
refs/heads/master: bedbe4ee86195dcd899577828714cc1413beb571
20 changes: 13 additions & 7 deletions trunk/drivers/kvm/paging_tmpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ static bool FNAME(cmpxchg_gpte)(struct kvm *kvm,
return (ret != orig_pte);
}

static unsigned FNAME(gpte_access)(struct kvm_vcpu *vcpu, pt_element_t gpte)
{
unsigned access;

access = (gpte & (PT_WRITABLE_MASK | PT_USER_MASK)) | ACC_EXEC_MASK;
#if PTTYPE == 64
if (is_nx(vcpu))
access &= ~(gpte >> PT64_NX_SHIFT);
#endif
return access;
}

/*
* Fetch a guest pte for a guest virtual address
*/
Expand Down Expand Up @@ -166,13 +178,7 @@ static int FNAME(walk_addr)(struct guest_walker *walker,
pte |= PT_ACCESSED_MASK;
}

pte_access = pte & (PT_WRITABLE_MASK | PT_USER_MASK);
pte_access |= ACC_EXEC_MASK;
#if PTTYPE == 64
if (is_nx(vcpu))
pte_access &= ~(pte >> PT64_NX_SHIFT);
#endif
pte_access &= pt_access;
pte_access = pt_access & FNAME(gpte_access)(vcpu, pte);

if (walker->level == PT_PAGE_TABLE_LEVEL) {
walker->gfn = gpte_to_gfn(pte);
Expand Down

0 comments on commit 4407c19

Please sign in to comment.