From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A6BFEC433F5 for ; Tue, 31 May 2022 16:16:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=J2CSvdhW7uE0pYcWJ5bsSfxEOVMLgG4Zs93KIktD1t4=; b=eDLN7zNnxCg4+b DYkyRrwurd5gmFMTBXUY8kK4hHngXFIxvSD3KbuFJMnEcTyKaVov4/iygrL8yngUWaOqu3XXNnJza 9fvlgiuOSZTxhyX2AX89pieieWHi7bh4WjYfV6ip0vPTsIgmMFrP6NsNiSKdaCz/xb5lFINy6BQjs Jh77sKKdYMVUua8/z8yB+KuSBc11yclP5M7zWTXJzZhtgnx/N4AyPJCB5ZmMGeGYqdXYcmYpm1+/i 7X8f1Z/X+f2cZChqZH/PCV/oMwlBrrUp7ZT237jd2s0ADuAAEZ+HUYxm2NfLUapWxo6E4yKDkY0fn mSMbqDaoYk6biu5WPz2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nw4We-00Bjse-5B; Tue, 31 May 2022 16:15:20 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nw4Wa-00BjrE-B3 for linux-arm-kernel@lists.infradead.org; Tue, 31 May 2022 16:15:17 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9243AB81235; Tue, 31 May 2022 16:15:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08CE2C385A9; Tue, 31 May 2022 16:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654013713; bh=ztvgCS8fRDKevpyO8kfxRzUmJyQtb9CbHw0LvkPe3z8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EwU9SA3Q0QwHRGV/O1ph9cWHDdnUrAclRMUVedLVhrPRlzuhpbrCVpq2LuZWeeajM CbM8hAQolPve4NGkntUaQOi4m3C0XGqZyF1+QJH52J90VAn8kbYe7uqgIBbqNnzAVT cVNU1lg0Dzj3RFeIahW5Wuc/qvyu3gVX5G9zLRgJd/G4WI3eXAvkP+5NlJgJ0j7D26 ecPxdX00ITbttgrprGLmTJHKCNnLw818ybiWYvoY00dfyF3KToimQqt9fBE5UMGNm5 whrex7z71U3f1kuqGbuWyIgu8DOwFZmFKA4W/Tl1LvpKyAGvIsz/J1MtLb2CUSqVKV vk732sDM0cgwQ== Date: Tue, 31 May 2022 17:15:06 +0100 From: Will Deacon To: Alexandru Elisei Cc: kvmarm@lists.cs.columbia.edu, Ard Biesheuvel , Sean Christopherson , Andy Lutomirski , Catalin Marinas , James Morse , Chao Peng , Quentin Perret , Suzuki K Poulose , Michael Roth , Mark Rutland , Fuad Tabba , Oliver Upton , Marc Zyngier , kernel-team@android.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 03/89] KVM: arm64: Return error from kvm_arch_init_vm() on allocation failure Message-ID: <20220531161505.GD25502@willie-the-truck> References: <20220519134204.5379-1-will@kernel.org> <20220519134204.5379-4-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220531_091516_568493_65E9C8A3 X-CRM114-Status: GOOD ( 23.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, May 20, 2022 at 04:55:51PM +0100, Alexandru Elisei wrote: > Hi, > > On Thu, May 19, 2022 at 02:40:38PM +0100, Will Deacon wrote: > > If we fail to allocate the 'supported_cpus' cpumask in kvm_arch_init_vm() > > then be sure to return -ENOMEM instead of success (0) on the failure > > path. > > > > Signed-off-by: Will Deacon > > --- > > arch/arm64/kvm/arm.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c > > index 523bc934fe2f..775b52871b51 100644 > > --- a/arch/arm64/kvm/arm.c > > +++ b/arch/arm64/kvm/arm.c > > @@ -146,8 +146,10 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) > > if (ret) > > goto out_free_stage2_pgd; > > > > - if (!zalloc_cpumask_var(&kvm->arch.supported_cpus, GFP_KERNEL)) > > + if (!zalloc_cpumask_var(&kvm->arch.supported_cpus, GFP_KERNEL)) { > > + ret = -ENOMEM; > > goto out_free_stage2_pgd; > > + } > > cpumask_copy(kvm->arch.supported_cpus, cpu_possible_mask); > > > > kvm_vgic_early_init(kvm); > > Thank you for the fix: > > Reviewed-by: Alexandru Elisei Thanks! > This can go in independent of the series. I can send it after rc1 if you > prefer to focus on something else. Cheers, but I reckon I'll post the first 6 patches as their own series at -rc1 anyway. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel