lkml.org 
[lkml]   [2021]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v6 27/29] KVM: Optimize overlapping memslots check
Date
On 01.12.2021 04:08, Sean Christopherson wrote:
> On Tue, Nov 30, 2021, Maciej S. Szmigiero wrote:
>> From: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
>>
>> Do a quick lookup for possibly overlapping gfns when creating or moving
>> a memslot instead of performing a linear scan of the whole memslot set.
>>
>> Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
>> [sean: tweaked params to avoid churn in future cleanup]
>> Signed-off-by: Sean Christopherson <seanjc@google.com>
>> ---
>> virt/kvm/kvm_main.c | 35 +++++++++++++++++++++--------------
>> 1 file changed, 21 insertions(+), 14 deletions(-)
>>
>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>> index 086f18969bc3..52117f65bc5b 100644
>> --- a/virt/kvm/kvm_main.c
>> +++ b/virt/kvm/kvm_main.c
>> @@ -1817,6 +1817,18 @@ static int kvm_set_memslot(struct kvm *kvm,
>> return 0;
>> }
>>
>> +static bool kvm_check_memslot_overlap(struct kvm_memslots *slots, int id,
>> + gfn_t start, gfn_t end)
>> +{
>> + struct kvm_memslot_iter iter;
>> +
>> + kvm_for_each_memslot_in_gfn_range(&iter, slots, start, end)
>
> The for loop needs curly braces, per coding-style.rst:
>
> Also, use braces when a loop contains more than a single simple statement:
>
> .. code-block:: c
>
> while (condition) {
> if (test)
> do_something();
> }
>
> With that,
>
> Reviewed-by: Sean Christopherson <seanjc@google.com>
>

Will add these braces (and your R-b, too).

Thanks,
Maciej

\
 
 \ /
  Last update: 2021-12-01 16:47    [W:0.059 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site