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

RE: [PATCH 19/37] xen/x86: promote VIRTUAL_BUG_ON to ASSERT in


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Tue, 18 Jan 2022 07:52:22 +0000
  • Accept-language: en-US
  • 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=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=R0bC3nRW2CkyJey2gRqlaMlCg/riHqtqLAkbv8PXnIU=; b=Gwh6J+Nkt2KqZ8fsWdeMhGjC5zSVD1ceT2Scm3jMc2cTLNR0F/Xsy1d56g8OOS41jxCT5CBV0gB4nOUalgzT/WdNeg5i6uJtweSt7PRQOephV4wG8voJc0vdRTn2QxK5jaR/LTc+zRYny+5OQuUGvihHmsiyQxb3RpI8VjHBcAfYiAuklHBPp2QiUlUhfUdfHRUOjCfWPV9mKhxUMzhDFys0ks2o3UQHgNlE6ojBbUYycY8VG4vOdck6iMTDxPWMpmLpjNF0/T3Xn1atmwKMl7AuD1SEwtNkANeDoFOFLQtHBbRl1fhHbfv/66uKf7yqLTB+CsaElk16jb6bzvwG0g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EjobZpHltx4b78ZA7wWkQ3IK5Qq/uwTVQwSNhQr3a/e+Tw0cCND6SGZHTlhvN3f8p0Z1AD4NOYQMpL7vGuj0+2e3vKdg4NS/N30+4iPJJDqNMzwVKwSLCFqtrKjq+5QYzYX/dJMEqXoxsDRm846aJSowbjw41uZmf6Y4HwC5yLVTT1NfYDXCphRW1jPZI0lxpSJMw2Wxb636NFkTbX4BTBh3TzvHdAwVXkeHr3FU9Y/NXZ7Qx/bWhBTDgGYcU1aQ+iR0L4Fc4ios/N4WDHoW2tkETAZXNpNUPuwoaVwcxNd3D1q2TF6+/QZtdN819QfRVIdk+06mZLa/hqZrW7BF+g==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>
  • Delivery-date: Tue, 18 Jan 2022 07:52:56 +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: AQHXsHMn8Y5/XlVHUEa264O87lW9PqxoG8SAgAED8gA=
  • Thread-topic: [PATCH 19/37] xen/x86: promote VIRTUAL_BUG_ON to ASSERT in

Hi Jan,

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: 2022年1月18日 0:22
> To: Wei Chen <Wei.Chen@xxxxxxx>
> Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>; xen-
> devel@xxxxxxxxxxxxxxxxxxxx; sstabellini@xxxxxxxxxx; julien@xxxxxxx
> Subject: Re: [PATCH 19/37] xen/x86: promote VIRTUAL_BUG_ON to ASSERT in
> 
> On 23.09.2021 14:02, Wei Chen wrote:
> > VIRTUAL_BUG_ON that is using in phys_to_nid is an empty macro. This
> > results in two lines of error-checking code in phys_to_nid are not
> > actually working. It also covers up two compilation errors:
> > 1. error: ‘MAX_NUMNODES’ undeclared (first use in this function).
> >    This is because MAX_NUMNODES is defined in xen/numa.h.
> >    But asm/numa.h is a dependent file of xen/numa.h, we can't
> >    include xen/numa.h in asm/numa.h. This error has been fixed
> >    after we move phys_to_nid to xen/numa.h.
> 
> This could easily be taken care of by move MAX_NUMNODES up ahead of
> the asm/numa.h inclusion point. And then the change here would become
> independent of the rest of the series (and could hence go in early).
> 
> > 2. error: wrong type argument to unary exclamation mark.
> >    This is becuase, the error-checking code contains !node_data[nid].
> >    But node_data is a data structure variable, it's not a pointer.
> >
> > So, in this patch, we use ASSERT in VIRTUAL_BUG_ON to enable the two
> > lines of error-checking code.
> 
> May I suggest to drop VIRTUAL_BUG_ON() and instead use ASSERT()
> directly?
> 

Sure!

> Jan


 


Rackspace

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