aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2009-02-13 11:23:16 +0900
committerIsaku Yamahata <yamahata@valinux.co.jp>2009-02-13 11:23:16 +0900
commit336841f92537c1a17263e663173897ef47c3c9ab (patch)
tree5ccab6c34ff3b8f40ce31d96e5048feb4ae34888
parent6c5523a925e50eed9c8a0bf6000f1fd0d2bea8aa (diff)
downloadxen-336841f92537c1a17263e663173897ef47c3c9ab.tar.gz
xen-336841f92537c1a17263e663173897ef47c3c9ab.tar.bz2
xen-336841f92537c1a17263e663173897ef47c3c9ab.zip
[IA64] shrink ia64 struct page_info.
This patch is the ia64 counter part of 19107:0858f961c77a, 19132:5848b49b74fc and 19136:162cdb596b9a. This patch shrink ia64 struct page_info and rearrange its members. The shrinking is made compile time option in config.h with default off becuase physical address size is architected to 50bit by ia64 and mfn isn't always addressed by 32bits with 16KB page size. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
-rw-r--r--xen/arch/ia64/Rules.mk13
-rw-r--r--xen/arch/ia64/xen/domain.c21
-rw-r--r--xen/include/asm-ia64/mm.h27
3 files changed, 53 insertions, 8 deletions
diff --git a/xen/arch/ia64/Rules.mk b/xen/arch/ia64/Rules.mk
index 3109a0a37e..bef11c3196 100644
--- a/xen/arch/ia64/Rules.mk
+++ b/xen/arch/ia64/Rules.mk
@@ -16,6 +16,13 @@ xen_ia64_tlb_track_cnt ?= n
xen_ia64_tlbflush_clock ?= y
xen_ia64_disable_optvfault ?= n
+# If they are enabled,
+# shrink struct page_info assuming all mfn can be addressed by 32 bits.
+# However, with 50bit ia64 architected physical address and 16KB page size,
+# mfn isn't always assessed by 32bit. So they are disabled by default.
+xen_ia64_shrink_page_list ?= n
+xen_ia64_pickle_domain ?= n
+
# Used only by linux/Makefile.
AFLAGS_KERNEL += -mconstant-gp -nostdinc $(CPPFLAGS)
@@ -71,5 +78,11 @@ endif
ifeq ($(xen_ia64_disable_optvfault),y)
CFLAGS += -DCONFIG_XEN_IA64_DISABLE_OPTVFAULT
endif
+ifeq ($(xen_ia64_shrink_page_list),y)
+CFLAGS += -DCONFIG_IA64_SHRINK_PAGE_LIST
+endif
+ifeq ($(xen_ia64_pickle_domain),y)
+CFLAGS += -DCONFIG_IA64_PICKLE_DOMAIN
+endif
LDFLAGS = -g
diff --git a/xen/arch/ia64/xen/domain.c b/xen/arch/ia64/xen/domain.c
index 2cf4a55666..2b6ab31d12 100644
--- a/xen/arch/ia64/xen/domain.c
+++ b/xen/arch/ia64/xen/domain.c
@@ -407,12 +407,29 @@ void relinquish_vcpu_resources(struct vcpu *v)
struct domain *alloc_domain_struct(void)
{
- return xmalloc(struct domain);
+#ifdef CONFIG_IA64_PICKLE_DOMAIN
+ struct domain *d;
+ /*
+ * We pack the MFN of the domain structure into a 32-bit field within
+ * the page_info structure. Hence the MEMF_bits() restriction.
+ */
+ d = alloc_xenheap_pages(get_order_from_bytes(sizeof(*d)),
+ MEMF_bits(32 + PAGE_SHIFT));
+ if ( d != NULL )
+ memset(d, 0, sizeof(*d));
+ return d;
+#else
+ return xmalloc(struct domain);
+#endif
}
void free_domain_struct(struct domain *d)
{
- xfree(d);
+#ifdef CONFIG_IA64_PICKLE_DOMAIN
+ free_xenheap_pages(d, get_order_from_bytes(sizeof(*d)));
+#else
+ xfree(d);
+#endif
}
struct vcpu *alloc_vcpu_struct(void)
diff --git a/xen/include/asm-ia64/mm.h b/xen/include/asm-ia64/mm.h
index afd65d61ff..1568786ea6 100644
--- a/xen/include/asm-ia64/mm.h
+++ b/xen/include/asm-ia64/mm.h
@@ -39,19 +39,26 @@ typedef unsigned long page_flags_t;
#define PRtype_info "016lx"
-#if 0
+#ifdef CONFIG_IA64_SHRINK_PAGE_LIST
/*
* See include/xen/mm.h.
- * For now, abandon to compress struct page_info
- * seeing IA64_MAX_PHYS_BITS and page size.
+ * To compress page_list_entry, all the physical address must
+ * be addressed by (32 + PAGE_SHIFT) .
+ * However this is lower than IA64_MAX_PHYS_BITS = 50.
*/
#undef page_list_entry
struct page_list_entry
{
- unsigned long next, prev;
+ u32 next, prev;
};
#endif
+#ifdef CONFIG_IA64_PICKLE_DOMAIN
+typedef u32 __ia64_domain_t;
+#else
+typedef unsigned long __ia64_domain_t;
+#endif
+
struct page_info
{
/* Each frame can be threaded onto a doubly-linked list. */
@@ -65,10 +72,10 @@ struct page_info
/* Page is in use: ((count_info & PGC_count_mask) != 0). */
struct {
- /* Owner of this page (NULL if page is anonymous). */
- unsigned long _domain; /* pickled format */
/* Type reference count and various PGT_xxx flags and fields. */
unsigned long type_info;
+ /* Owner of this page (NULL if page is anonymous). */
+ __ia64_domain_t _domain; /* pickled format */
} inuse;
/* Page is on a free list: ((count_info & PGC_count_mask) == 0). */
@@ -132,8 +139,16 @@ struct page_info
#define is_xen_heap_mfn(mfn) (mfn_valid(mfn) && \
is_xen_heap_page(mfn_to_page(mfn)))
+#ifdef CONFIG_IA64_PICKLE_DOMAIN
+#define page_get_owner(_p) \
+ ((struct domain *)((_p)->v.inuse._domain ? \
+ mfn_to_virt((_p)->v.inuse._domain) : NULL))
+#define page_set_owner(_p,_d) \
+ ((_p)->v.inuse._domain = (_d) ? virt_to_mfn(_d) : 0)
+#else
#define page_get_owner(_p) ((struct domain *)(_p)->u.inuse._domain)
#define page_set_owner(_p, _d) ((_p)->u.inuse._domain = (unsigned long)(_d))
+#endif
#define XENSHARE_writable 0
#define XENSHARE_readonly 1