lkml.org 
[lkml]   [2020]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 02/22] kvm: mmu: Introduce tdp_iter
From
Date
On 30/09/20 07:24, Sean Christopherson wrote:
> Maybe use the params, if only to avoid the line wrap?
>
> iter->gfn = goal_gfn - (goal_gfn % KVM_PAGES_PER_HPAGE(root_level));
>
> Actually, peeking further into the file, this calculation is repeated in both
> try_step_up and try_step_down, probably worth adding a helper of some form.

Also it's written more concisely as

iter->gfn = goal_gfn & -KVM_PAGES_PER_HPAGE(iter->level);

>
>
> bool done;
>
> if (try_step_down(iter))
> return;
>
> do {
> done = try_step_side(iter);
> } while (!done && try_step_up(iter));
>
> iter->valid = done;

I pointed out something similar in my review, my version was

bool done;

if (try_step_down(iter))
return;

do {
if (try_step_side(iter))
return;
} while (try_step_up(iter));
iter->valid = false;

Paolo

\
 
 \ /
  Last update: 2020-09-30 08:25    [W:0.108 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site