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

RE: [PATCH v3 2/2] xen/common: Use enhanced ASSERT_ALLOC_CONTEXT in xmalloc()


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Tue, 24 May 2022 01:53:30 +0000
  • Accept-language: zh-CN, 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=VbfsLqG6kt3nCXdCjZQaJuK5vul4eNOGgwf/vjiIsus=; b=bNKmSNQzVLhJp+Ml4TMuTAhf+n/0+0OSrGqvkBLGFn4YI0ggjs2dyvFdPUw4xCXnFPB6Wv40UWaMQyEEsxSSKS7/nd2h3s/VSJBQe9jHabU77bdp92itYTq1YqYDeGaxFBGRb+cfjirD2RyY/rigo/Qd7ZqmogKK2dc6IblpsVv5ucIr2D8Wvikd8GwyrpmAoMj2zEi4qLNrI0uCpCrUr2MLcYAPr3Wy/mELW1XTTFo5IgkIvqPXpcUvN+WCMS2gwggmc3IRgl27HGoC1PQhU5PwdOG6f9gkmuFJXEQjSbXmxRuxeJezuBOlmokWhzLPWJZVui/dQVkhl5QJQKnrCw==
  • 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=VbfsLqG6kt3nCXdCjZQaJuK5vul4eNOGgwf/vjiIsus=; b=a/6AtzCDhiBWQnb//UzwNZH9Gg0yh2q8onj7RROemlZJ+tti31mMd3CbJ9blrrOBvYLrZ+nTgFGIXo2e0+R3Sr8yNTgw1glwPwsYBNwk6E6kcobHPPcOqZhZMFXo95f6kGV36oCCdLd7XolG3EfD0kcFmcN0Nx3Ud/8msXAkC2DdUnSyBVzo201mHzCgdrgC29rwV01io2Euitw+X2SmyEPSW6ergG/+V2flAhbXp18oT5lI05A9tHB1e989Csb5uoNfEPYiYsB3vxd6f41ZUeQymK+R+NT2f2BTLyzjPrfq6TrMrdKb6KVVBr/Tx6Qk6SB/QmV4aZcY29HhDoA58A==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=iDmA2awDW/nZqOfMJveuIetBwLN+/YzZ2XwFaNr9YQVhKAjD60JcMREvyGgzYNqFfZlwq2NZOaJjgc94W5P8S1Bameo50heRGyUhpMur0sabANZpMK6+yYxsg61wmz9mAmk7J82Ac9YybhpHo6dtz1cTPd84gaI+EaGGlUXwkZkwPLDYUqU8NNvbKwvzjXwdxTD4bBerRQXVyZ7NNQ4dJ5spO+5q0tnTqVcH+kghqs678ht1+MMaqqOo/10Zm6XrohDqnrH+JMDeendP+ZH2UrTq+kBSHUDS9nlX5xu+8H4/5mzcVcPIE+BVP2toADxETpdeAiM2neL2yBFp55VLSQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=keRRVUOwfAkEE51Rhz0eegPl93vhoGP9LNz4YUtKIhUiKr3TFMhQqjml7AhYbT5TZsu0ddQvzZ4tap+Ei8FeBrGL5q204tB5jY2YvEjCBEvfRJMZHKX8/kGxj6QLYmPPfyV+GfoCwkUivSJAegBG3ODjE16NRfsd3A3vqS4uhL9rLR2OqNbIpi++0XErhrQnxMO6GnKd4KM2aN44VNxdOLGbMZhDfWpa50QvlXKvNEJzdE3eUiGK7VujJ2woIRg67s/t4BrULfpGbQFRXhTnd4vNt2YLJuP3H2wJR7qDjDnfa5mb0fxM5vMiAQMJUcrI18sJATy2LGsm/RGCFCN+0w==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>
  • Delivery-date: Tue, 24 May 2022 07:41:47 +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: AQHYYb3lzX/A67bY90iFDVxfuK8rvK0f3b6AgA1/p8A=
  • Thread-topic: [PATCH v3 2/2] xen/common: Use enhanced ASSERT_ALLOC_CONTEXT in xmalloc()

Hi Julien,

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Subject: Re: [PATCH v3 2/2] xen/common: Use enhanced
> ASSERT_ALLOC_CONTEXT in xmalloc()
> 
> Hi,
> 
> On 07/05/2022 03:54, Henry Wang wrote:
> > diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
> > index e866e0d864..ea59cd1a4a 100644
> > --- a/xen/common/page_alloc.c
> > +++ b/xen/common/page_alloc.c
> > @@ -162,13 +162,6 @@
> >   static char __initdata opt_badpage[100] = "";
> >   string_param("badpage", opt_badpage);
> >
> > -/*
> > - * Heap allocations may need TLB flushes which may require IRQs to be
> > - * enabled (except when only 1 PCPU is online).
> > - */
> > -#define ASSERT_ALLOC_CONTEXT() \
> > -    ASSERT(!in_irq() && (local_irq_is_enabled() || num_online_cpus() <=
> 1))
> > -
> FYI, the patch introducing ASSERT_ALLOC_CONTEXT() has been reverted. I
> intend to re-introduce it once your previous patch and the one fixing
> the ITS (not yet formally sent) have been committed.

Thanks for the information! IIUC the patch:
"xen/arm: gic-v3-lpi: Allocate the pending table while preparing the CPU"
is merged. So I guess both "page_alloc: assert IRQs are enabled in heap 
alloc/free"
and this patch can be re-introduced if everyone is happy with the patch?

> 
> I have also checked that none of the ASSERTs() would be triggered on my
> x86 setup. So:
> 
> Tested-by: Julien Grall <jgrall@xxxxxxxxxx>
> Acked-by: Julien Grall <jgrall@xxxxxxxxxx>

Thank you very much for both testing and acking this patch!

Kind regards,
Henry

> 
> On a side note (no action expected for you), I noticed that the
> ASSERT()s would only trigger from CPU2 and onwards at least for Arm.
> This is because num_online_cpus() would still be 1 when bringing-up CPU1.
> 
> I went through the original discussion and I am not sure why we switched
> from < SYS_STATE_smp_boot to num_online_cpus() (aside that Arm
> doesn't
> set it). Aynway, this is not a major issue here as this is an ASSERT().
> 
> Cheers,
> 
> --
> Julien Grall

 


Rackspace

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