diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-01-06 08:20:11 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-01-06 08:20:11 +0000 |
commit | c65d37be54debe7d43d9fba62d2c146d95155fbb (patch) | |
tree | 1b5400d746b562864bedc15e69eeaf0e970f05d8 | |
parent | bf3f5a47a09bfac278c08679bd142869e55df19d (diff) | |
download | xen-c65d37be54debe7d43d9fba62d2c146d95155fbb.tar.gz xen-c65d37be54debe7d43d9fba62d2c146d95155fbb.tar.bz2 xen-c65d37be54debe7d43d9fba62d2c146d95155fbb.zip |
[IA64] Fix ia64 build
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
-rw-r--r-- | xen/arch/ia64/xen/mm.c | 9 | ||||
-rw-r--r-- | xen/common/grant_table.c | 2 | ||||
-rw-r--r-- | xen/common/memory.c | 16 | ||||
-rw-r--r-- | xen/include/asm-ia64/mm.h | 3 |
4 files changed, 26 insertions, 4 deletions
diff --git a/xen/arch/ia64/xen/mm.c b/xen/arch/ia64/xen/mm.c index 6fcdece762..461a38e151 100644 --- a/xen/arch/ia64/xen/mm.c +++ b/xen/arch/ia64/xen/mm.c @@ -195,7 +195,7 @@ static void __xencomm_mark_dirty(struct domain *d, 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 --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 243ceb95ad..cba4f85d7e 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -114,7 +114,7 @@ static unsigned inline int max_nr_maptrack_frames(void) __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 --git a/xen/common/memory.c b/xen/common/memory.c index acd131e994..329483756a 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -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 @@ out: 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, unsigned long gmfn) } 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, unsigned long gmfn) 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_HANDLE(xen_memory_exchange_t) arg) 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_HANDLE(xen_memory_exchange_t) arg) rc = -ENOMEM; goto fail; } +#else /* !CONFIG_X86 */ + mfn = gmfn_to_mfn(d, gmfn + k); +#endif if ( unlikely(!mfn_valid(mfn)) ) { rc = -EINVAL; diff --git a/xen/include/asm-ia64/mm.h b/xen/include/asm-ia64/mm.h index b50871f272..4e104832b3 100644 --- a/xen/include/asm-ia64/mm.h +++ b/xen/include/asm-ia64/mm.h @@ -534,6 +534,7 @@ extern u64 translate_domain_pte(u64 pteval, u64 address, u64 itir__, #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__ */ |