[PATCH v2 19/26] KVM: arm64: nv: Add trap forwarding for HFGxTR_EL2

Marc Zyngier maz at kernel.org
Sat Jul 29 02:20:57 PDT 2023


On Fri, 28 Jul 2023 19:47:40 +0100,
Oliver Upton <oliver.upton at linux.dev> wrote:
> 
> Hey Marc,
> 
> On Fri, Jul 28, 2023 at 09:29:45AM +0100, Marc Zyngier wrote:
> 
> [...]
> 
> > @@ -943,6 +1025,27 @@ void __init populate_nv_trap_config(void)
> >  	kvm_info("nv: %ld coarse grained trap handlers\n",
> >  		 ARRAY_SIZE(encoding_to_cgt));
> 
> It might make sense to skip insertion of the FGT trap controls if the
> system doesn't have FGT in the first place.

Yup, good point.

> 
> > +	for (int i = 0; i < ARRAY_SIZE(encoding_to_fgt); i++) {
> > +		const struct encoding_to_trap_config *fgt = &encoding_to_fgt[i];
> > +		union trap_config tc;
> > +
> > +		tc = get_trap_config(fgt->encoding);
> > +
> > +		WARN(tc.fgt,
> > +		     "Duplicate FGT for sys_reg(%d, %d, %d, %d, %d)\n",
> > +		     sys_reg_Op0(fgt->encoding),
> > +		     sys_reg_Op1(fgt->encoding),
> > +		     sys_reg_CRn(fgt->encoding),
> > +		     sys_reg_CRm(fgt->encoding),
> > +		     sys_reg_Op2(fgt->encoding));
> 
> Same comment here, we should just bail.

Yup. I'll also turn it into a kvm_err() instead, as WARN() is too
noisy (nobody needs the same stack trace 200 times).

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.



More information about the linux-arm-kernel mailing list