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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 9DD05C433EF for ; Tue, 14 Jun 2022 11:06:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.348789.574969 (Exim 4.92) (envelope-from ) id 1o14N6-0005My-7S; Tue, 14 Jun 2022 11:06:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 348789.574969; Tue, 14 Jun 2022 11:06:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o14N6-0005Mr-2d; Tue, 14 Jun 2022 11:06:08 +0000 Received: by outflank-mailman (input) for mailman id 348789; Tue, 14 Jun 2022 11:06:06 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o14N4-0005Mj-Lm for xen-devel@lists.xenproject.org; Tue, 14 Jun 2022 11:06:06 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-flk1.inumbo.com (Halon) with ESMTP id f22fd588-ebd1-11ec-8901-93a377f238d6; Tue, 14 Jun 2022 13:05:48 +0200 (CEST) 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 D1AFA1424; Tue, 14 Jun 2022 04:05:57 -0700 (PDT) Received: from [10.57.11.30] (unknown [10.57.11.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7417F3F73B; Tue, 14 Jun 2022 04:05:56 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f22fd588-ebd1-11ec-8901-93a377f238d6 Message-ID: <998ad0b5-1835-025c-9329-e80695247033@arm.com> Date: Tue, 14 Jun 2022 13:05:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] xen/arm: irq: Initialize the per-CPU IRQs while preparing the CPU Content-Language: en-US To: Julien Grall , xen-devel@lists.xenproject.org Cc: andrew.cooper3@citrix.com, Julien Grall , Stefano Stabellini , Bertrand Marquis , Volodymyr Babchuk References: <20220614094157.95631-1-julien@xen.org> From: Michal Orzel In-Reply-To: <20220614094157.95631-1-julien@xen.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Julien, On 14.06.2022 11:41, Julien Grall wrote: > From: Julien Grall > > Commit 5047cd1d5dea "xen/common: Use enhanced ASSERT_ALLOC_CONTEXT in > xmalloc()" extended the checks in _xmalloc() to catch any use of the > helpers from context with interrupts disabled. > > Unfortunately, the rule is not followed when initializing the per-CPU > IRQs: > > (XEN) Xen call trace: > (XEN) [<002389f4>] _xmalloc+0xfc/0x314 (PC) > (XEN) [<00000000>] 00000000 (LR) > (XEN) [<0021a7c4>] init_one_irq_desc+0x48/0xd0 > (XEN) [<002807a8>] irq.c#init_local_irq_data+0x48/0xa4 > (XEN) [<00280834>] init_secondary_IRQ+0x10/0x2c > (XEN) [<00288fa4>] start_secondary+0x194/0x274 > (XEN) [<40010170>] 40010170 > (XEN) > (XEN) > (XEN) **************************************** > (XEN) Panic on CPU 2: > (XEN) Assertion '!in_irq() && (local_irq_is_enabled() || num_online_cpus() <= 1)' failed at common/xmalloc_tlsf.c:601 > (XEN) **************************************** > > This is happening because zalloc_cpumask_var() may allocate memory > if NR_CPUS is > 2 * sizeof(unsigned long). > > Avoid the problem by allocate the per-CPU IRQs while preparing the > CPU. Shouldn't this be" by initializing the per-CPU IRQs while ..." ? Either way this text is the same like in the previous patch so I think this is not correct. Other than that: Reviewed-by: Michal Orzel