[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <diqz347riy1b.fsf@google.com>
Date: Thu, 09 Oct 2025 14:08:00 -0700
From: Ackerley Tng <ackerleytng@...gle.com>
To: "Garg, Shivank" <shivankg@....com>, Sean Christopherson <seanjc@...gle.com>, Marc Zyngier <maz@...nel.org>,
Oliver Upton <oliver.upton@...ux.dev>, Paolo Bonzini <pbonzini@...hat.com>
Cc: linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.linux.dev,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
David Hildenbrand <david@...hat.com>, Fuad Tabba <tabba@...gle.com>, Ashish Kalra <ashish.kalra@....com>,
Vlastimil Babka <vbabka@...e.cz>
Subject: Re: [PATCH v12 01/12] KVM: guest_memfd: Rename "struct kvm_gmem" to
"struct gmem_file"
"Garg, Shivank" <shivankg@....com> writes:
> On 10/8/2025 3:44 AM, Sean Christopherson wrote:
>>
>> [...snip...]
>>
>> @@ -659,18 +667,18 @@ static struct folio *__kvm_gmem_get_pfn(struct file *file,
>> pgoff_t index, kvm_pfn_t *pfn,
>> bool *is_prepared, int *max_order)
>> {
>> - struct file *gmem_file = READ_ONCE(slot->gmem.file);
>> - struct kvm_gmem *gmem = file->private_data;
>> + struct file *slot_file = READ_ONCE(slot->gmem.file);
>> + struct gmem_file *f = file->private_data;
> ^^^
>> struct folio *folio;
>>
>> - if (file != gmem_file) {
>> - WARN_ON_ONCE(gmem_file);
>> + if (file != slot_file) {
>> + WARN_ON_ONCE(slot_file);
>> return ERR_PTR(-EFAULT);
>> }
>>
>> - gmem = file->private_data;
>> - if (xa_load(&gmem->bindings, index) != slot) {
>> - WARN_ON_ONCE(xa_load(&gmem->bindings, index));
>> + f = file->private_data;
>
> This redundant initialization can be dropped.
>
> I sent a cleanup patch including this change a few weeks ago:
Agree, and probably good to opportunistically drop this line in this
patch than to combine cleanups in Shivank's other patch.
>
> https://lore.kernel.org/kvm/20250902080307.153171-2-shivankg@amd.com
>
> Could you please review it?
>
> Everything else looks good to me!
>
> Reviewed-by: Shivank Garg <shivankg@....com>
>
Reviewed-by: Ackerley Tng <ackerleytng@...gle.com>
Tested-by: Ackerley Tng <ackerleytng@...gle.com>
>> + if (xa_load(&f->bindings, index) != slot) {
>> + WARN_ON_ONCE(xa_load(&f->bindings, index));
>> return ERR_PTR(-EIO);
>> }
>>
>
> Thanks,
> Shivank
Powered by blists - more mailing lists