Re: [RFC PATCH v3 04/11] KVM: arm64: Setup a framework for hypercall bitmap firmware registers

From: Reiji Watanabe
Date: Fri Jan 14 2022 - 01:24:09 EST


> > > > > +static void
> > > > > +kvm_arm_get_fw_reg_bmap(struct kvm_vcpu *vcpu, u64 fw_reg_bmap, u64 *val)
> > > > > +{
> > > > > + struct kvm *kvm = vcpu->kvm;
> > > > > +
> > > > > + mutex_lock(&kvm->lock);
> > > > > + *val = fw_reg_bmap;
> > > > > + mutex_unlock(&kvm->lock);
> > > >

I have another comment for kvm_arm_get_fw_reg_bmap.

I just noticed that @fw_reg_bmap is a value of the bitmap register
(not a pointer). I believe what you meant was a pointer to
hvc_desc->hvc_*_bmap. Also, you can remove @val and return the register
value instead (change the type of the return value from void to u64).
I'm not sure if you will keep this function in the next version though.

Thanks,
Reiji