[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7871cd67-156a-4823-9b0d-d54ee4b72dd0@xen.org>
Date: Tue, 20 Feb 2024 08:59:39 +0000
From: Paul Durrant <xadimgnik@...il.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, Jonathan Corbet <corbet@....net>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Janosch Frank <frankja@...ux.ibm.com>,
Claudio Imbrenda <imbrenda@...ux.ibm.com>,
David Hildenbrand <david@...hat.com>, Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>, Alexander Gordeev
<agordeev@...ux.ibm.com>, Sven Schnelle <svens@...ux.ibm.com>,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
David Woodhouse <dwmw2@...radead.org>, Shuah Khan <shuah@...nel.org>,
kvm@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org,
linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v13 04/21] KVM: pfncache: add a mark-dirty helper
On 19/02/2024 21:42, Sean Christopherson wrote:
> On Thu, Feb 15, 2024, Paul Durrant wrote:
>> +/**
>> + * kvm_gpc_mark_dirty_in_slot - mark a cached guest page as dirty.
>> + *
>> + * @gpc: struct gfn_to_pfn_cache object.
>
> Meh, just omit the kerneldoc comment.
>
>> + */
>> +static inline void kvm_gpc_mark_dirty_in_slot(struct gfn_to_pfn_cache *gpc)
>> +{
>> + lockdep_assert_held(&gpc->lock);
>> + if (gpc->memslot)
>> + mark_page_dirty_in_slot(gpc->kvm, gpc->memslot,
>> + gpc->gpa >> PAGE_SHIFT);
>
> It's kinda silly, but I think it's worth landing this below gpa_to_gfn() so that
> there's no need to open code the shift.
>
> And I have a (very) slight preference for an early return.
>
> static inline void kvm_gpc_mark_dirty_in_slot(struct gfn_to_pfn_cache *gpc)
> {
> lockdep_assert_held(&gpc->lock);
>
> if (!gpc->memslot)
> return;
>
> mark_page_dirty_in_slot(gpc->kvm, gpc->memslot, gpa_to_gfn(gpc->gpa));
> }
>
Ok. Will change.
>> +}
>> +
>> void kvm_sigset_activate(struct kvm_vcpu *vcpu);
>> void kvm_sigset_deactivate(struct kvm_vcpu *vcpu);
>>
>> --
>> 2.39.2
>>
Powered by blists - more mailing lists