[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <61d23bc0-771d-9110-6528-3658a55ccba6@redhat.com>
Date: Wed, 30 Sep 2020 08:24:17 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <sean.j.christopherson@...el.com>,
Ben Gardon <bgardon@...gle.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Cannon Matthews <cannonmatthews@...gle.com>,
Peter Xu <peterx@...hat.com>, Peter Shier <pshier@...gle.com>,
Peter Feiner <pfeiner@...gle.com>,
Junaid Shahid <junaids@...gle.com>,
Jim Mattson <jmattson@...gle.com>,
Yulei Zhang <yulei.kernel@...il.com>,
Wanpeng Li <kernellwp@...il.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Xiao Guangrong <xiaoguangrong.eric@...il.com>
Subject: Re: [PATCH 02/22] kvm: mmu: Introduce tdp_iter
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
Powered by blists - more mailing lists