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 8CD48C433F5 for ; Tue, 17 May 2022 17:21:17 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.331327.554812 (Exim 4.92) (envelope-from ) id 1nr0sM-0005Mo-2q; Tue, 17 May 2022 17:20:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 331327.554812; Tue, 17 May 2022 17:20:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nr0sL-0005Mh-W1; Tue, 17 May 2022 17:20:49 +0000 Received: by outflank-mailman (input) for mailman id 331327; Tue, 17 May 2022 17:20:48 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nr0sK-0005Mb-8I for xen-devel@lists.xenproject.org; Tue, 17 May 2022 17:20:48 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nr0sJ-0000aT-Ug; Tue, 17 May 2022 17:20:47 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] helo=[10.95.147.55]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nr0sJ-000701-OV; Tue, 17 May 2022 17:20:47 +0000 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" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=tdxgFkAJbWMcqzAdfW43MICaHgB+iXP1p8ozzhZ5qAE=; b=jdoOIShvTsIIQPVFz6j722wu0e N6wYF8G+Ji3Z2PFocb9YK5Uo8waiK5ysq1084xxiNOrQPtbR6roqh7UwVcxRAWRDPPqKIzR11BXFo oAOVbhzVUwdZNNjttp1oH+b1hkBmkZ1Yc2paLOcA78GDioLPW+OIh/j3UA8JRcYxQqnU=; Message-ID: Date: Tue, 17 May 2022 18:20:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v2] xen/arm: gic-v3-lpi: Allocate the pending table while preparing the CPU To: Bertrand Marquis Cc: "xen-devel@lists.xenproject.org" , Julien Grall , Stefano Stabellini , Volodymyr Babchuk References: <20220516170246.19908-1-julien@xen.org> <89313424-EB15-4A9B-B215-178460F035C4@arm.com> From: Julien Grall In-Reply-To: <89313424-EB15-4A9B-B215-178460F035C4@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 17/05/2022 09:58, Bertrand Marquis wrote: >> On 16 May 2022, at 18:02, Julien Grall wrote: >> >> From: Julien Grall >> >> Commit 88a037e2cfe1 "page_alloc: assert IRQs are enabled in heap >> alloc/free" extended the checks in the buddy allocator to catch any >> use of the helpers from context with interrupts disabled. >> >> Unfortunately, the rule is not followed in the LPI code when allocating >> the pending table: >> >> (XEN) Xen call trace: >> (XEN) [<000000000022a678>] alloc_xenheap_pages+0x178/0x194 (PC) >> (XEN) [<000000000022a670>] alloc_xenheap_pages+0x170/0x194 (LR) >> (XEN) [<0000000000237770>] _xmalloc+0x144/0x294 >> (XEN) [<00000000002378d4>] _xzalloc+0x14/0x30 >> (XEN) [<000000000027b4e4>] gicv3_lpi_init_rdist+0x54/0x324 >> (XEN) [<0000000000279898>] arch/arm/gic-v3.c#gicv3_cpu_init+0x128/0x46 >> (XEN) [<0000000000279bfc>] arch/arm/gic-v3.c#gicv3_secondary_cpu_init+0x20/0x50 >> (XEN) [<0000000000277054>] gic_init_secondary_cpu+0x18/0x30 >> (XEN) [<0000000000284518>] start_secondary+0x1a8/0x234 >> (XEN) [<0000010722aa4200>] 0000010722aa4200 >> (XEN) >> (XEN) >> (XEN) **************************************** >> (XEN) Panic on CPU 2: >> (XEN) Assertion '!in_irq() && (local_irq_is_enabled() || num_online_cpus() <= 1)' failed at common/page_alloc.c:2212 >> (XEN) **************************************** >> >> For now the patch extending the checks has been reverted, but it would >> be good to re-introduce it (allocation with interrupt is not desirable). >> >> The logic is reworked to allocate the pending table when preparing the >> CPU. >> >> Signed-off-by: Julien Grall > > With the print fixed as pointed by Michal you can add my: > Reviewed-by: Bertrand Marquis Thanks! > > (Fix could be done on commit but that is up to you). I have fixed it and committed it. Cheers, -- Julien Grall