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

[PATCH v2 1/2] mm: introduce INVALID_{G,M}FN_RAW


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 10 Dec 2021 10:39:55 +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=nQbHxo+SG7zXc0WpjqfjCW7hun4rktAxwnnAypfq9w8=; b=kW1zSbcpjDlW4j9XfeKz6MqmJ48wMeFNz//z5i0qs1ZG9/0DGE8q/XYYgB900CNxoFXEpr6dpY+FG6efjvIduORArLcQLMo/4xzcX82np3AiV3sUAa1RIWztxfqwriCbPGT79wgDausvy5v/bICQgKhkTeZHSb7yM/e7l+W/Z8h78G/Q6s++QgxtWEQD/U2dPeG7G3wrHUBTtkK2xXZZidKgu5xzTMKGhQoflJRSXG7hLHlMFpE43nixnLWti5wzz5xzP8CvJ9AvijbBc92QngaSWb3StTlmRoNvl9T0+zwGuGgcTuM7a/ju5NH9ScXfLA+buH8/wqE9n5oIoB/CwQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jvb9SjtqNm+73m7UPu624dGUJHV7WA7/IaB303mWKvUOi30Umc7B1kmqOk+PiBwLLiZCEHCWU+uinj7YCXlpomw0LgJ7VQ6Tw02NIISYJreJxEjH09xhByWgITZB3NLl2b/RiZKHIXIbohs9OaGlj4I9YjB/82qHGcIByvLUrGRztN25jY92bntC5y9Vq/SCt3z10EpQfqy7qoHsK5WkkiDRgGAM598YO60mH7er71WH3hMvb+KwDP5rcXmf0IZ2UWjJMovclui9u008q2JBIvuM3s1Q6pB3Xo10tkt8QWMwVOBnFR75s9rkABVJHcL94xhI5m9pl3pQTdwou7mLKQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 10 Dec 2021 09:40:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This allows properly tying together INVALID_{G,M}FN and
INVALID_{G,M}FN_INITIALIZER as well as using the actual values in
compile time constant expressions (or even preprocessor dirctives).

Since INVALID_PFN is unused, and with x86'es paging_mark_pfn_dirty()
being the only user of pfn_t it also doesn't seem likely that new uses
would appear, remove that one at this same occasion.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
v2: New.

--- a/xen/include/xen/mm-frame.h
+++ b/xen/include/xen/mm-frame.h
@@ -6,12 +6,13 @@
 
 TYPE_SAFE(unsigned long, mfn);
 #define PRI_mfn          "05lx"
-#define INVALID_MFN      _mfn(~0UL)
+#define INVALID_MFN_RAW  (~0UL)
+#define INVALID_MFN      _mfn(INVALID_MFN_RAW)
 /*
  * To be used for global variable initialization. This workaround a bug
  * in GCC < 5.0.
  */
-#define INVALID_MFN_INITIALIZER { ~0UL }
+#define INVALID_MFN_INITIALIZER { INVALID_MFN_RAW }
 
 #ifndef mfn_t
 #define mfn_t /* Grep fodder: mfn_t, _mfn() and mfn_x() are defined above */
@@ -44,12 +45,13 @@ static inline bool_t mfn_eq(mfn_t x, mfn
 
 TYPE_SAFE(unsigned long, gfn);
 #define PRI_gfn          "05lx"
-#define INVALID_GFN      _gfn(~0UL)
+#define INVALID_GFN_RAW  (~0UL)
+#define INVALID_GFN      _gfn(INVALID_GFN_RAW)
 /*
  * To be used for global variable initialization. This workaround a bug
  * in GCC < 5.0 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64856
  */
-#define INVALID_GFN_INITIALIZER { ~0UL }
+#define INVALID_GFN_INITIALIZER { INVALID_GFN_RAW }
 
 #ifndef gfn_t
 #define gfn_t /* Grep fodder: gfn_t, _gfn() and gfn_x() are defined above */
@@ -82,7 +84,6 @@ static inline bool_t gfn_eq(gfn_t x, gfn
 
 TYPE_SAFE(unsigned long, pfn);
 #define PRI_pfn          "05lx"
-#define INVALID_PFN      (~0UL)
 
 #ifndef pfn_t
 #define pfn_t /* Grep fodder: pfn_t, _pfn() and pfn_x() are defined above */




 


Rackspace

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