[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] xen/arm: gic-v3-lpi: Allocate the pending table while preparing the CPU


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Tue, 17 May 2022 08:58:18 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=10wHUjDuDNEQyWZqwt7Dfjx5Ae5tYxjzFLMn4L83xOM=; b=d1mX+VcwuHIqoWSGiSnO2XdvL3m3gt52SVORXtYx8MJ03EAbheks9qo7Gz8RwoziGYlHBuZ8NUxoKjRW8EyaPUePrelT/NUq0PiUjenuxcurenL1jPFGceNw7DL6N8AG2ketv+OHRdEDbUMKRFMblfW9XypeB3oK2sU3LpMbPuSPPUq/nCpGgQt5XjDettv5R1EFSw1+asJCGXQaZFeGpRuaRjIPLb+2o7CPUcOzsDsUMxJpMdtGLxTQpHmBN1WX/KINuCgykTtIS7heFWDeJhmgJaRvjRarf/wI7Ew//HHq+oQ8TXwpGu7K58elczTMUk5nANb2cxNwFUDOac/sDA==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=10wHUjDuDNEQyWZqwt7Dfjx5Ae5tYxjzFLMn4L83xOM=; b=j8J/c2gWwizZDpYydTQZ72uQ0PIDaUSF9pNb9Chsx/nNIMscY2sud/HZdMeYgDxtYe7TfhhLLjhJHuD44EdSOEw7ASbr/kB0pyAGwO153IC446cFPgT6hqqqGK2IcCyf+QcdN3rHczZKzDrbq26Dvq4kH9Jbt9t2LodX7TiNJdXHa/Fl5vi0iRyCi6DzSqZRdVXWKXBYckHYIUciELqDXw+MxngT/gkgnT37tHMBcOKs019Pz/1zxwcDQY5SpxZky4/vlqPTUwFyq8SD/YyrQiuBgwNAb8bGy0toKOQumikZ0sHnBXRqdOD1TanhFX90v12kICy8yqpaY+gk052e1Q==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=RzW0xefCA/3Q4+zSD9/mSD0BBrLnkmOt3CthRmsXfYIF0ncnTU6aBGdLpjd3F2RF3ryPyDGZ/3NcjLVRQWtbEtfZ7vCEiQYquFv25Mf/FVsbK4WkYT+DM1p3UIim568myG6J5ICqih9rh7HSeS1DM905y1X5+OQiQM4jdeA2hIY9RpqVABnyzOPV0moWSOrK5GBL429J/z0zaM8xs7qb8MtleTBknBk32bQMIpSDNFaCTUXKH3M8NglsvYvc2kjYqkGvX/khgQkZhtfjY3zL4DoG3m5DEn86jkLbHSYR4MvpyzIFKXyjs7rRuysIb2qLPvDMyT8fnGOwCEoAw72U5g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U5J6ImnobAJpgl0G7dqxKsT+h0OXCYPZ1rFR1W+Fix2MRCJbcoqcFtjl96hUq/KtIQIR8NX2DZcgPT35dV3ecvGdp2tY6zidvFdpOEo0kATU7jdMHVZjWPpa9+tNapFDcANPgMkvfkXeOcCy4mspCvw+PXpyerRxSaR9mMsC2lTL53n/hVSvRIEQ3T47GpubgvcI0+tdCHIag5deea5wY8s7KGEvBMN4lYg5BBiLARa5YH+N5V+32FCWgxSqIYh4ebocIV9XSyZ/7lDsW4RcFLeg6VuoBQW7JhTxcME0xjBP/nIW7TDocwUIKxAJiqfqaWciJWW0T0DN9X32cjQw1g==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 17 May 2022 08:58:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYaUbNn/1ZVAYT+kGgDN69tRiyPq0ixfIA
  • Thread-topic: [PATCH v2] xen/arm: gic-v3-lpi: Allocate the pending table while preparing the CPU

Hi Julien,

> On 16 May 2022, at 18:02, Julien Grall <julien@xxxxxxx> wrote:
> 
> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
> 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 <jgrall@xxxxxxxxxx>

With the print fixed as pointed by Michal you can add my:
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

(Fix could be done on commit but that is up to you).

Cheers
Bertrand




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.