xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH RFC 1/5] xen: move round_pg{up,down} to pfn.h
Date: Fri, 3 Mar 2017 09:41:07 +0000	[thread overview]
Message-ID: <20170303094111.12217-2-wei.liu2@citrix.com> (raw)
In-Reply-To: <20170303094111.12217-1-wei.liu2@citrix.com>

They are going to be needed in multiple places. Instead of replicating
more, move them to pfn.h.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/domain_build.c | 3 ---
 xen/common/page_alloc.c     | 4 +---
 xen/include/xen/pfn.h       | 3 +++
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index e4b60d436f..00ce5f24e9 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -267,9 +267,6 @@ boolean_param("ro-hpet", ro_hpet);
 #define L3_PROT (BASE_PROT|_PAGE_DIRTY)
 #define L4_PROT (BASE_PROT|_PAGE_DIRTY)
 
-#define round_pgup(_p)    (((_p)+(PAGE_SIZE-1))&PAGE_MASK)
-#define round_pgdown(_p)  ((_p)&PAGE_MASK)
-
 static unsigned int __initdata memflags = MEMF_no_dma|MEMF_exact_node;
 
 static struct page_info * __init alloc_chunk(
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 530ede1d20..42c20cb201 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -131,6 +131,7 @@
 #include <xen/domain_page.h>
 #include <xen/keyhandler.h>
 #include <xen/perfc.h>
+#include <xen/pfn.h>
 #include <xen/numa.h>
 #include <xen/nodemask.h>
 #include <xen/event.h>
@@ -176,9 +177,6 @@ size_param("bootscrub_chunk", opt_bootscrub_chunk);
 static unsigned int dma_bitsize;
 integer_param("dma_bits", dma_bitsize);
 
-#define round_pgdown(_p)  ((_p)&PAGE_MASK)
-#define round_pgup(_p)    (((_p)+(PAGE_SIZE-1))&PAGE_MASK)
-
 /* Offlined page list, protected by heap_lock. */
 PAGE_LIST_HEAD(page_offlined_list);
 /* Broken page list, protected by heap_lock. */
diff --git a/xen/include/xen/pfn.h b/xen/include/xen/pfn.h
index 3626197de3..ed9d27d568 100644
--- a/xen/include/xen/pfn.h
+++ b/xen/include/xen/pfn.h
@@ -6,4 +6,7 @@
 #define PFN_DOWN(x)   ((x) >> PAGE_SHIFT)
 #define PFN_UP(x)     (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
 
+#define round_pgup(_p)    (((_p)+(PAGE_SIZE-1))&PAGE_MASK)
+#define round_pgdown(_p)  ((_p)&PAGE_MASK)
+
 #endif /* __XEN_PFN_H__ */
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-03-03  9:41 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03  9:41 [PATCH RFC 0/5] Refactor x86 domain builder Wei Liu
2017-03-03  9:41 ` Wei Liu [this message]
2017-03-03 10:05   ` [PATCH RFC 1/5] xen: move round_pg{up, down} to pfn.h Jan Beulich
2017-03-03 10:15     ` Wei Liu
2017-03-03  9:41 ` [PATCH RFC 2/5] xen: include xen/types.h in domain.h Wei Liu
2017-03-03 10:05   ` Jan Beulich
2017-03-03  9:41 ` [PATCH RFC 3/5] x86: split PV dom0 builder to domain_build_pv.c Wei Liu
2017-03-03 11:06   ` Roger Pau Monné
2017-03-03 11:15     ` Jan Beulich
2017-03-03 13:35       ` Wei Liu
2017-03-03 14:33         ` Jan Beulich
2017-03-03 14:45           ` Wei Liu
2017-03-03 14:49             ` Andrew Cooper
2017-03-03 15:15               ` Jan Beulich
2017-03-03 17:08               ` Wei Liu
2017-03-03 16:16   ` Jan Beulich
2017-03-03  9:41 ` [PATCH RFC 4/5] x86: split PVH " Wei Liu
2017-03-03 11:16   ` Roger Pau Monné
2017-03-03 13:39     ` Wei Liu
2017-03-03 15:38       ` Roger Pau Monné
2017-03-03 16:18   ` Jan Beulich
2017-03-03  9:41 ` [PATCH RFC 5/5] x86: clean up header files in domain_build.c Wei Liu
2017-03-03 16:18   ` Jan Beulich
2017-03-03 10:02 ` [PATCH RFC 0/5] Refactor x86 domain builder Jan Beulich
2017-03-03 10:56 ` Andrew Cooper
2017-03-03 11:06   ` Jan Beulich
2017-03-03 13:41     ` Wei Liu
2017-03-03 14:34       ` Jan Beulich
2017-03-03 14:45         ` Wei Liu
2017-03-03 11:06   ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170303094111.12217-2-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).