From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C14D61A4F1B for ; Fri, 29 Nov 2024 16:33:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732898004; cv=none; b=Vn0IUH7775pKZsU1bekgGaoXzTPHSK/kghhSaUlGzKjIb0q2rao2OXZqpiyiFOAEKSb3+LchdSehyulPwP0I67E74tToJq9Y9R1B7ZcStlmevvCAJH1/YumutHbBDnaNvnDsZ6nwOMBjId0uEjrKXSuxL81qNAfKMSgqjqLC+0Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732898004; c=relaxed/simple; bh=kdPahxlehedR0bU11HAXpJw5Gjp74fVBXVHcgNP257w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nnuRc3Fats8zTRQ6WeT1RPY0UenJsl95JwrDKpkcsRlcO+1X7e98iYaOBRs4c1OXwelENafzMiOCrQX7W69H+nBSV0zjDZCQ/GW9BvLGeEP6oBJTf07Q6pDxv4NyWkoci1CXxP6RW5d6uZ81SFMma+F5+6CeKb4r1uNo667QrVU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Fri, 29 Nov 2024 08:33:02 -0800 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Keisuke Nishimura Cc: Marc Zyngier , Joey Gouly , Suzuki K Poulose , Zenghui Yu , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: Re: [PATCH] KVM: arm/arm64: vgic-its: Add error handling in vgic_its_cache_translation Message-ID: References: <20241128134534.361144-1-keisuke.nishimura@inria.fr> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT 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