Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248099
b: refs/heads/master
c: 12cb814
h: refs/heads/master
i:
  248097: fdcbd2c
  248095: 4a2acc9
v: v3
  • Loading branch information
Takuya Yoshikawa authored and Avi Kivity committed May 22, 2011
1 parent 520a9c7 commit edc7b30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 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: 5ce941ee4258b836cf818d2ac159d8cf3ebad648
refs/heads/master: 12cb814f3bb35736420cc6bfc9fed7b6a9d3a828
16 changes: 1 addition & 15 deletions trunk/arch/x86/kvm/paging_tmpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,6 @@ static unsigned FNAME(gpte_access)(struct kvm_vcpu *vcpu, pt_element_t gpte)
return access;
}

static int FNAME(read_gpte)(pt_element_t *pte, pt_element_t __user *ptep_user)
{
#if defined(CONFIG_X86_32) && (PTTYPE == 64)
u32 *p = (u32 *)pte;
u32 __user *p_user = (u32 __user *)ptep_user;

if (unlikely(get_user(*p, p_user)))
return -EFAULT;
return get_user(*(p + 1), p_user + 1);
#else
return get_user(*pte, ptep_user);
#endif
}

/*
* Fetch a guest pte for a guest virtual address
*/
Expand Down Expand Up @@ -199,7 +185,7 @@ static int FNAME(walk_addr_generic)(struct guest_walker *walker,
}

ptep_user = (pt_element_t __user *)((void *)host_addr + offset);
if (unlikely(FNAME(read_gpte)(&pte, ptep_user))) {
if (unlikely(copy_from_user(&pte, ptep_user, sizeof(pte)))) {
present = false;
break;
}
Expand Down

0 comments on commit edc7b30

Please sign in to comment.