lkml.org 
[lkml]   [2012]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/13] KVM: MMU: introduce FNAME(get_sp_gpa)
On 03/29/2012 11:22 AM, Xiao Guangrong wrote:
> It can calculate the base gpa of the specified shadow page on any level,
> let it instead of FNAME(get_level1_sp_gpa)
>
>
> +static gpa_t FNAME(get_sp_gpa)(struct kvm_mmu_page *sp)
> +{

Maybe worth adding a pte index and calling it get_spte_gpa(), depends on
the next patches I guess.

> + int offset, shift;
> +
> + shift = PAGE_SHIFT - (PT_LEVEL_BITS - PT64_LEVEL_BITS) * sp->role.level;
> + offset = sp->role.quadrant << shift;

if you add '& ~PAGE_MASK' the compiler may be smart enough to drop the
whole thing for 64-bit ptes.

> +
> + return gfn_to_gpa(sp->gfn) + offset;
> +}
> +
> /*
> * Page fault handler. There are several causes for a page fault:
> * - there is no shadow pte for the guest pte
> @@ -659,18 +669,6 @@ out_unlock:
> return 0;
>

--
error compiling committee.c: too many arguments to function



\
 
 \ /
  Last update: 2012-03-29 15:11    [W:0.240 / U:2.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site