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 D38B7C4332F for ; Sun, 12 Nov 2023 14:02:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231675AbjKLOCQ (ORCPT ); Sun, 12 Nov 2023 09:02:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbjKLOCO (ORCPT ); Sun, 12 Nov 2023 09:02:14 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C23612688 for ; Sun, 12 Nov 2023 06:02:11 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4125CC433C7; Sun, 12 Nov 2023 14:02:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699797731; bh=uhqHuJIoGSHWpXphAwLZ0jMdtuBaXhHFCFmNhM/i8w4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=X+m/xeNx8XhEv71vXwlLYyIOvOkszKN71z/kPzLJAessjjGnkNatGCh3pNyqIblAQ Hkdro0GIabjK50cPdpczKaJbKJLjkJkPfsfXc3J8gKArAaq1hjXCf3n/Fhg8SmCPBq cB5TyItbpzNMR03xX/2Vr/wCgVoDvbLzdnULL4RYAMl/XnoDpi+byiK5wlw/CYBey0 jKQZlEJXwUBbv1eOyQjtM2JqF4fXC3GPMYxdg30Otl5hmlsSk3hfIYNEpklzmWMhKm RAyI/oBcbRC1rUXsgprNNNxQrdJb8JywSTQs9M9NeHlyqSzrKlhIgfx/AwPxmdX8uf Etu/sbfS3bCIQ== Received: from [185.201.63.253] (helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1r2B2O-00CRrV-KB; Sun, 12 Nov 2023 14:02:08 +0000 Date: Sun, 12 Nov 2023 14:00:42 +0000 Message-ID: <87fs1bxe9h.wl-maz@kernel.org> From: Marc Zyngier To: Paran Lee Cc: Thomas Gleixner , linux-kernel@vger.kernel.org, shjy180909@gmail.com, austindh.kim@gmail.com Subject: Re: [PATCH] irqdesc: Fail check on early_irq_init allocation. In-Reply-To: <20231111170035.10386-1-p4ranlee@gmail.com> References: <20231111170035.10386-1-p4ranlee@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.201.63.253 X-SA-Exim-Rcpt-To: p4ranlee@gmail.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, shjy180909@gmail.com, austindh.kim@gmail.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 11 Nov 2023 17:00:36 +0000, Paran Lee wrote: > > When doing start_kernel(), > On early_irq_init(), alloc_desc() or alloc_percpu() > may be fails. So, Explicit fail check needed on dynamic allocation. A failing allocation already results in a massive splat describing how the allocation failed. Further use of the NULL pointer will also result in a terminal oops, particularly if this happens this early in the boot sequence. So what do these BUG_ON() calls buy us? M. -- Without deviation from the norm, progress is not possible.