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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58B60C433EF for ; Fri, 20 May 2022 15:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347830AbiETPzw (ORCPT ); Fri, 20 May 2022 11:55:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351191AbiETPzu (ORCPT ); Fri, 20 May 2022 11:55:50 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1D689179955 for ; Fri, 20 May 2022 08:55:42 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CB7801480; Fri, 20 May 2022 08:55:41 -0700 (PDT) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A884A3F73D; Fri, 20 May 2022 08:55:38 -0700 (PDT) Date: Fri, 20 May 2022 16:55:51 +0100 From: Alexandru Elisei To: Will Deacon 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: References: <20220519134204.5379-1-will@kernel.org> <20220519134204.5379-4-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220519134204.5379-4-will@kernel.org> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 This can go in independent of the series. I can send it after rc1 if you prefer to focus on something else. Thanks, Alex 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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id E79BDC433EF for ; Fri, 20 May 2022 15:55:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2CA3F41049; Fri, 20 May 2022 11:55:48 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Yg8SpohsHELp; Fri, 20 May 2022 11:55:45 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id EB24D4B20F; Fri, 20 May 2022 11:55:45 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id EB9A04B365 for ; Fri, 20 May 2022 11:55:44 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ksTI2w2TCgQM for ; Fri, 20 May 2022 11:55:42 -0400 (EDT) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mm01.cs.columbia.edu (Postfix) with ESMTP id AF21F4B20F for ; Fri, 20 May 2022 11:55:42 -0400 (EDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CB7801480; Fri, 20 May 2022 08:55:41 -0700 (PDT) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A884A3F73D; Fri, 20 May 2022 08:55:38 -0700 (PDT) Date: Fri, 20 May 2022 16:55:51 +0100 From: Alexandru Elisei To: Will Deacon Subject: Re: [PATCH 03/89] KVM: arm64: Return error from kvm_arch_init_vm() on allocation failure Message-ID: References: <20220519134204.5379-1-will@kernel.org> <20220519134204.5379-4-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220519134204.5379-4-will@kernel.org> Cc: Marc Zyngier , kvm@vger.kernel.org, Andy Lutomirski , linux-arm-kernel@lists.infradead.org, Michael Roth , Catalin Marinas , Chao Peng , kernel-team@android.com, kvmarm@lists.cs.columbia.edu X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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 This can go in independent of the series. I can send it after rc1 if you prefer to focus on something else. Thanks, Alex _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 2F842C433F5 for ; Fri, 20 May 2022 15:57:18 +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=IwH5xPUL6IFSuNYQnJqooZXJnG+fh/xlCZ5UG3nhsyY=; b=Icqmz/RPCCH+qF iTpTNsEmzUAWq6XvksTebavL8S58BA5Q+T4l4W1+PhBSaNRo6BfAd/iElJIHqbwc1kaOOB4n0rmtq +TIlmmpqHl9jRGPwMdSr0ZC4mIUuCLv7IT0jGmrncdhgxeS6mrPg3H26EZMWCa8zGb2Uzd5FylB4H QETvBT1Hz8K0EzT9h1qKlJsCOKi/Nit1qSHGhJgdYVasfOP3FXjcXsahGcdEYJbu5t6QVbt+6q5wC wlwIcKyWuP6S0OaxEqUfr+mftc5bQIDCXmRYhITKlvpKSusMjlD+J5ITdDi8CzygA75DKgGvXxen3 w4qbHUO3qGzqIwwkpjLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ns4yl-00DMGY-In; Fri, 20 May 2022 15:55:51 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ns4yi-00DMEG-26 for linux-arm-kernel@lists.infradead.org; Fri, 20 May 2022 15:55:49 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CB7801480; Fri, 20 May 2022 08:55:41 -0700 (PDT) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A884A3F73D; Fri, 20 May 2022 08:55:38 -0700 (PDT) Date: Fri, 20 May 2022 16:55:51 +0100 From: Alexandru Elisei To: Will Deacon 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: References: <20220519134204.5379-1-will@kernel.org> <20220519134204.5379-4-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220519134204.5379-4-will@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220520_085548_182358_93CCA17B X-CRM114-Status: GOOD ( 17.83 ) 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 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 This can go in independent of the series. I can send it after rc1 if you prefer to focus on something else. Thanks, Alex _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel