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

[PATCH] move PAGE_ALIGN() to common header


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 9 Aug 2023 12:50:49 +0200
  • 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=C1GQHusw4elOucUIan9J4ndko7DdBkW3IAgTLctyzHs=; b=nD/Zp7rHCIbGfpbqcbsSBRB27l3c4gzq1WVMupY1pg+Wck/WSr/yjZ0aft502S+uiSJDAtb4AQxhnmZqCXsuwlsPB7gukQxU7cet/RkPGgpKZbgzEUNWV8dlet0j0KVcNEKbBeLmmYLNj7AqILV1hfXyb1waGqcV349OkXJ3FKDV1zj/7hiPqehM9GcPp5GQIAMPOtLE8W5PnifcjQfvzfWNaWOArilR9RceKzNuZ9FGTD88vyxVxwVsRT02BJDtMMPO5pbUgDHil2B/uK4X8eHiP7Ri7+XOFTwkAhA+IO2SDtq34vK4X8p8ZXJFf5cpyxbhOzMes02c4XC5gkRMoQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RFe4HA4Y49KLAaP1LuMJtKAY6YGczGurCwJOeG6H0xwN5CeIqNuOIhdboQF3px3elN+vZ9eMqwNnZ3lHG6GwA7ziG22i77EYeYU2tUfHLFigCSnzAVno5LkpP2/X5VFQ/D59k1zTxYCFjjrZQO+fFuKLtTFYuq2be4+7+A0bRGZH3x3U28Ad+AR5wCX+T3ziNjFiQH+bHMaO25HBBrj+Jo5G6nsxln5ZulnOJF4OnSRDA8N/SNRnSjpkzZRc/WodtGUzLjQ3QgL1hzi3a9dqKDBmAnn5/jJa/6IMoHEi+1FgmLcqtZWsazY3fS0p9sF7PBFqSBGy9SmBQNiWUrYktg==
  • 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>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 09 Aug 2023 10:51:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Much like we have PAGE_OFFSET() there already, there's also no reason
for each arch to define identical PAGE_ALIGN().

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

--- a/xen/arch/arm/include/asm/page.h
+++ b/xen/arch/arm/include/asm/page.h
@@ -303,8 +303,6 @@ static inline int gva_to_ipa(vaddr_t va,
 
 #endif /* __ASSEMBLY__ */
 
-#define PAGE_ALIGN(x) (((x) + PAGE_SIZE - 1) & PAGE_MASK)
-
 #endif /* __ARM_PAGE_H__ */
 
 /*
--- a/xen/arch/x86/include/asm/page.h
+++ b/xen/arch/x86/include/asm/page.h
@@ -404,8 +404,6 @@ static inline void invalidate_icache(voi
 
 #endif /* !__ASSEMBLY__ */
 
-#define PAGE_ALIGN(x) (((x) + PAGE_SIZE - 1) & PAGE_MASK)
-
 #endif /* __X86_PAGE_H__ */
 
 /*
--- a/xen/include/xen/page-size.h
+++ b/xen/include/xen/page-size.h
@@ -10,7 +10,8 @@
  */
 #define PAGE_SIZE           (_AC(1,L) << PAGE_SHIFT)
 #define PAGE_MASK           (~(PAGE_SIZE-1))
-#define PAGE_OFFSET(ptr)   ((unsigned long)(ptr) & ~PAGE_MASK)
+#define PAGE_OFFSET(ptr)    ((unsigned long)(ptr) & ~PAGE_MASK)
+#define PAGE_ALIGN(x)       (((x) + PAGE_SIZE - 1) & PAGE_MASK)
 
 #define PADDR_MASK          ((_AC(1,ULL) << PADDR_BITS) - 1)
 #define VADDR_MASK          (~_AC(0,UL) >> (BITS_PER_LONG - VADDR_BITS))



 


Rackspace

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