Re: [PATCH 04/19] KVM: arm64: Push checks for 64bit registers into the low-level accessors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 08 Jul 2022 07:13:36 +0100,
Reiji Watanabe <reijiw@xxxxxxxxxx> wrote:
> 
> Hi Marc,
> 
> On Wed, Jul 6, 2022 at 9:43 AM Marc Zyngier <maz@xxxxxxxxxx> wrote:
> >
> > Make sure the check occurs on every paths where we can pick
> > a sysreg from userspace, including the GICv3 paths.
> >
> > Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
> > ---
> >  arch/arm64/kvm/sys_regs.c | 10 ++++------
> >  1 file changed, 4 insertions(+), 6 deletions(-)
> >
> > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
> > index 0fbdb21a3600..89e7eddea937 100644
> > --- a/arch/arm64/kvm/sys_regs.c
> > +++ b/arch/arm64/kvm/sys_regs.c
> > @@ -2656,6 +2656,10 @@ const struct sys_reg_desc *get_reg_by_id(u64 id,
> >  {
> >         struct sys_reg_params params;
> >
> > +       /* 64 bit is the only way */
> > +       if (KVM_REG_SIZE(id) != sizeof(__u64))
> > +               return NULL;
> 
> This doesn't seem to be necessary since the equivalent check
> is done by index_to_params().

Ah, well spotted. Amusing how many times we check for the same thing!

I'll simplify the patch and amend the commit message.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm



[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux