[PATCH] KVM: arm/arm64: vgic-its: Add error handling in vgic_its_cache_translation

Oliver Upton oliver.upton at linux.dev
Fri Nov 29 08:33:02 PST 2024


On Fri, Nov 29, 2024 at 12:30:52PM +0100, Keisuke Nishimura wrote:
> On 29/11/2024 08:20, Oliver Upton wrote:
> >   - Store fails because of a failed memory allocation / error in xarray
> >     library.
> > 
> > We don't handle #3, and the correct thing to do in this case is to put
> > @irq since it was never made visible in the translation cache.
> > 
> > So I think we'd want to do something similar to the following.
> > 
> 
> Hello,
> 
> Thanks for the comment. xa_reserve() can allocate the memory in advance and
> ensure the success of the subsequent xa_store().

Yes, but xa_store() can fail for other reasons than a failed memory
allocation. Which is why I recommended adding an explicit error handling
path to cover *all* failures to store in the xarray.

-- 
Thanks,
Oliver



More information about the linux-arm-kernel mailing list