Re: [PATCH v2 15/18] KVM: arm64: Introduce __pkvm_host_mkyoung_guest()

From: Quentin Perret
Date: Wed Dec 11 2024 - 05:18:56 EST


On Wednesday 11 Dec 2024 at 10:11:17 (+0000), Fuad Tabba wrote:
> Hi Quentin,
>
> On Tue, 10 Dec 2024 at 19:46, Quentin Perret <qperret@xxxxxxxxxx> wrote:
> >
> > On Tuesday 10 Dec 2024 at 15:14:03 (+0000), Fuad Tabba wrote:
> > > > +int __pkvm_host_mkyoung_guest(u64 gfn, struct pkvm_hyp_vcpu *vcpu)
> > > > +{
> > > > + struct pkvm_hyp_vm *vm = pkvm_hyp_vcpu_to_hyp_vm(vcpu);
> > > > + u64 ipa = hyp_pfn_to_phys(gfn);
> > > > + u64 phys;
> > > > + int ret;
> > > > +
> > > > + host_lock_component();
> > > > + guest_lock_component(vm);
> > > > +
> > > > + ret = __check_host_unshare_guest(vm, &phys, ipa);
> > >
> > > While I'm bikeshedding some more, does the name
> > > __check_host_unshare_guest() make sense? Should it be something like
> > > __check_host_changeperm_guest(), or something along those lines? (feel
> > > free to ignore this :) )
> >
> > I understand the comment, but not a huge fan of 'changeperm' as that
> > sounds like we're only allowing permission changes while we use this
> > all over the place. Maybe __check_host_is_shared_guest()? Naming is
> > hard, so happy to take suggestions :-)
>
> I've gone and done it now :) I almost like that, it's the *is* part I
> don't like since it implied a boolean return. Maybe just
> __check_host_shared_guest(), no is?

Deal!

Cheers,
Quentin