lkml.org 
[lkml]   [2021]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 31/31] KVM: MMU: make spte an in-out argument in make_spte
From
On 29/09/21 01:20, David Matlack wrote:
>> bool make_spte(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
>> struct kvm_memory_slot *slot,
>> unsigned int pte_access, gfn_t gfn, kvm_pfn_t pfn,
>> - u64 old_spte, bool speculative, bool can_unsync,
>> - bool host_writable, u64 *new_spte)
>> + bool speculative, bool can_unsync,
>> + bool host_writable, u64 *sptep)
> I'd prefer a different name since `sptep` has specific meaning
> throughout the mmu code. (It's the address of the spte in the page
> table.)
>
> Case in point, I was going to suggest we can get rid of struct
> kvm_mmu_page since it can be derived from the sptep and then realized
> how wrong that was:).
>
> Instead of receiving the new spte as a parameter what do you think about
> changing make_spte to return the new spte? I think that would make the
> code more readable (but won't reduce the number of arguments because
> you'd have to add wrprot).
>

You have a point. I've dropped this patch for now.

Paolo

\
 
 \ /
  Last update: 2021-09-29 13:15    [W:0.088 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site