[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: Wei Chen <wei.chen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 17 Jan 2022 17:21:51 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=5Nx9XvAAsBuKMWe7wk0Gu6J6rItL5YmUsIVjL67O07g=; b=E0ELpAUse6fqrlQqmllRlH5tDenanzMLwehkT+4haYQR4d896J/5wePwCDXNtP/Q7oPnxDZxn6ej4PHqzdI9S6M3KRBi7ykLYAItGbHOKhai40nDL1HOrIOsx5vNXvUggiM+anPnNgAXHBagjDcjWxJq/ZPcgHEI7uwdItMOhELbDgtmGBZSIAYsqkXb9WaEUMe3Il42PBrp+qbJIfcLrR2c5JpWPPdoAZmaO6XQosu+8ZUobmZJFoH5dGXjCO+OxZKU8pHcPZ+gbuoABWxMQAaxZJ93mFadvRI4Bff1Ll7QUEaRgabkLVq9OCJTJuKzZSRG/nkgPyIa/3Cj975K7g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=biXr5pHEY/pNNX4kSmelV+YFi+ggw1Rr8WGEJnDikYSw/g2aM/85Gq4Hdzcy3XP+HCbo3nuJw820EQUArQgPc0ugBAnNWwAdq6PnOUVBmxs/Rn+6lRPxkRbeo8Fi1P4/c2xJudd4lJUz+DIDErbrMAb0eqK75+XQxCFZh+oVG3sDrsRm4ePGI/3O9CWGLbvhET6DOMIIqJukLpzXXj2G1kexDUkfO8Su6YHsm/yDR0MiWFHzVv7mVFm5PxYdz1TBC+dsEBccYJ0fytpAjTNUBsnQf3qgsEXP8lYVrEA2cb17KxzU22st5yZ+SFPbAKR6Zpqf+XQx51sl0Pr3ABupRg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Bertrand.Marquis@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, sstabellini@xxxxxxxxxx, julien@xxxxxxx
  • Delivery-date: Mon, 17 Jan 2022 16:22:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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?

Jan




 


Rackspace

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