Mailing List Archive

[xen-unstable] [IA64] Fix ia64 build
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1262766011 0
# Node ID 3984b8c7fa257254748edc270982dd7d3f371207
# Parent 4e56f809ddbf6061e0de3430a8fc74c62b00b441
[IA64] Fix ia64 build

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
---
xen/arch/ia64/xen/mm.c | 9 ++++++++-
xen/common/grant_table.c | 2 +-
xen/common/memory.c | 16 +++++++++++++++-
xen/include/asm-ia64/mm.h | 3 ++-
4 files changed, 26 insertions(+), 4 deletions(-)

diff -r 4e56f809ddbf -r 3984b8c7fa25 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c Wed Jan 06 08:18:04 2010 +0000
+++ b/xen/arch/ia64/xen/mm.c Wed Jan 06 08:20:11 2010 +0000
@@ -195,7 +195,7 @@ static void __xencomm_mark_dirty(struct

extern unsigned long ia64_iobase;

-struct domain *dom_xen, *dom_io;
+struct domain *dom_xen, *dom_io, *dom_cow;

/*
* This number is bigger than DOMID_SELF, DOMID_XEN and DOMID_IO.
@@ -223,6 +223,13 @@ alloc_dom_xen_and_dom_io(void)
*/
dom_io = domain_create(DOMID_IO, DOMCRF_dummy, 0);
BUG_ON(dom_io == NULL);
+
+ /*
+ * Initialise our DOMID_IO domain.
+ * This domain owns sharable pages.
+ */
+ dom_cow = domain_create(DOMID_COW, DOMCRF_dummy, 0);
+ BUG_ON(dom_cow == NULL);
}

static int
diff -r 4e56f809ddbf -r 3984b8c7fa25 xen/common/grant_table.c
--- a/xen/common/grant_table.c Wed Jan 06 08:18:04 2010 +0000
+++ b/xen/common/grant_table.c Wed Jan 06 08:20:11 2010 +0000
@@ -114,7 +114,7 @@ static unsigned inline int max_nr_maptra
__x = INVALID_MFN; \
__x; })
#else
-#define gfn_to_mfn_private(_d, _gfn) gmfn_to_mfn(rd, act->gfn)
+#define gfn_to_mfn_private(_d, _gfn) gmfn_to_mfn(_d, _gfn)
#endif

#define SHGNT_PER_PAGE_V1 (PAGE_SIZE / sizeof(grant_entry_v1_t))
diff -r 4e56f809ddbf -r 3984b8c7fa25 xen/common/memory.c
--- a/xen/common/memory.c Wed Jan 06 08:18:04 2010 +0000
+++ b/xen/common/memory.c Wed Jan 06 08:20:11 2010 +0000
@@ -22,7 +22,9 @@
#include <xen/tmem.h>
#include <asm/current.h>
#include <asm/hardirq.h>
-#include <asm/p2m.h>
+#ifdef CONFIG_X86
+# include <asm/p2m.h>
+#endif
#include <xen/numa.h>
#include <public/memory.h>
#include <xsm/xsm.h>
@@ -152,10 +154,16 @@ int guest_remove_page(struct domain *d,
int guest_remove_page(struct domain *d, unsigned long gmfn)
{
struct page_info *page;
+#ifdef CONFIG_X86
p2m_type_t p2mt;
+#endif
unsigned long mfn;

+#ifdef CONFIG_X86
mfn = mfn_x(gfn_to_mfn(d, gmfn, &p2mt));
+#else
+ mfn = gmfn_to_mfn(d, gmfn);
+#endif
if ( unlikely(!mfn_valid(mfn)) )
{
gdprintk(XENLOG_INFO, "Domain %u page number %lx invalid\n",
@@ -164,6 +172,7 @@ int guest_remove_page(struct domain *d,
}

page = mfn_to_page(mfn);
+#ifdef CONFIG_X86
/* If gmfn is shared, just drop the guest reference (which may or may not
* free the page) */
if(p2m_is_shared(p2mt))
@@ -173,6 +182,7 @@ int guest_remove_page(struct domain *d,
return 1;
}

+#endif /* CONFIG_X86 */
if ( unlikely(!get_page(page, d)) )
{
gdprintk(XENLOG_INFO, "Bad page free for domain %u\n", d->domain_id);
@@ -330,6 +340,7 @@ static long memory_exchange(XEN_GUEST_HA

for ( k = 0; k < (1UL << exch.in.extent_order); k++ )
{
+#ifdef CONFIG_X86
p2m_type_t p2mt;

/* Shared pages cannot be exchanged */
@@ -339,6 +350,9 @@ static long memory_exchange(XEN_GUEST_HA
rc = -ENOMEM;
goto fail;
}
+#else /* !CONFIG_X86 */
+ mfn = gmfn_to_mfn(d, gmfn + k);
+#endif
if ( unlikely(!mfn_valid(mfn)) )
{
rc = -EINVAL;
diff -r 4e56f809ddbf -r 3984b8c7fa25 xen/include/asm-ia64/mm.h
--- a/xen/include/asm-ia64/mm.h Wed Jan 06 08:18:04 2010 +0000
+++ b/xen/include/asm-ia64/mm.h Wed Jan 06 08:20:11 2010 +0000
@@ -534,6 +534,7 @@ extern u64 translate_domain_pte(u64 ptev

#define INVALID_M2P_ENTRY (~0UL)
#define VALID_M2P(_e) (!((_e) & (1UL<<63)))
+#define SHARED_M2P(_e) 0

#define set_gpfn_from_mfn(mfn, pfn) (machine_to_phys_mapping[(mfn)] = (pfn))
#define get_gpfn_from_mfn(mfn) (machine_to_phys_mapping[(mfn)])
@@ -575,6 +576,6 @@ int donate_page(

unsigned long domain_get_maximum_gpfn(struct domain *d);

-extern struct domain *dom_xen, *dom_io; /* for vmcoreinfo */
+extern struct domain *dom_xen, *dom_io, *dom_cow; /* for vmcoreinfo */

#endif /* __ASM_IA64_MM_H__ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog