From: Luca Miccio <206497@studenti.unimore.it> Date: Mon, 6 Jan 2020 15:51:53 +0000 (+0100) Subject: Fix x86 build X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4e3f3721bbd0b162cc406b98120ccad64ee9f85f;p=people%2Fsstabellini%2Fxen-unstable.git%2F.git Fix x86 build When compiling for X86 platforms there are errors related to includes. Add basic support for X86 platform. Signed-off-by: Luca Miccio <206497@studenti.unimore.it> --- diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 6159cc316e..f628a12c35 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -140,7 +140,6 @@ #include #include #include -#include #ifdef CONFIG_X86 #include #include @@ -1885,14 +1884,14 @@ void __init end_boot_allocator(void) { unsigned long nr_pages = 0; - C_DEBUG("Allocating 0x%lx for buddy allocator starting from: 0x%lx\n", + printk(XENLOG_INFO "Allocating 0x%lx for buddy allocator starting from: 0x%lx\n", buddy_required_size, pfn_to_paddr(r->s)); init_heap_pages(mfn_to_page(_mfn(r->s)), (buddy_required_size >> PAGE_SHIFT)); r->s += (buddy_required_size >> PAGE_SHIFT); nr_pages = (r->e - r->s); - C_DEBUG("COLORED: Init heap pages from 0x%lx with size: 0x%lx\n", + printk(XENLOG_INFO "COLORED: Init heap pages from 0x%lx with size: 0x%lx\n", pfn_to_paddr(r->s), nr_pages*PAGE_SIZE); if( !init_col_heap_pages(mfn_to_page(_mfn(r->s)), nr_pages) ) init_heap_pages(mfn_to_page(_mfn(r->s)), nr_pages); @@ -1900,7 +1899,7 @@ void __init end_boot_allocator(void) } else { - C_DEBUG("COLORED: Init heap pages from 0x%lx with size: 0x%lx\n", + printk(XENLOG_INFO "COLORED: Init heap pages from 0x%lx with size: 0x%lx\n", pfn_to_paddr(r->s),(r->e - r->s)*PAGE_SIZE); if( !init_col_heap_pages(mfn_to_page(_mfn(r->s)), r->e - r->s) ) init_heap_pages(mfn_to_page(_mfn(r->s)), r->e - r->s); diff --git a/xen/common/vmap.c b/xen/common/vmap.c index 571c895703..a1c5846cc7 100644 --- a/xen/common/vmap.c +++ b/xen/common/vmap.c @@ -8,7 +8,6 @@ #include #include #include -#include static DEFINE_SPINLOCK(vm_lock); static void *__read_mostly vm_base[VMAP_REGION_NR]; diff --git a/xen/include/asm-arm/coloring.h b/xen/include/asm-arm/coloring.h index 3b477121ea..bf8497afda 100644 --- a/xen/include/asm-arm/coloring.h +++ b/xen/include/asm-arm/coloring.h @@ -87,12 +87,6 @@ uint32_t *setup_default_colors(unsigned int *col_num); void coloring_dump_info(struct domain *d); -/* Colored allocator functions */ -bool init_col_heap_pages(struct page_info *pg, unsigned long nr_pages); -struct page_info *alloc_col_domheap_page( - struct domain *d, unsigned int memflags); -void free_col_heap_page(struct page_info *pg); - #else /* !CONFIG_COLORING */ #define XEN_COLOR_MAP_SIZE (_end - _start) @@ -102,28 +96,11 @@ static bool inline __init coloring_init(void) return true; } -static inline bool init_col_heap_pages( - struct page_info *pg, unsigned long nr_pages) -{ - return false; -} - -static inline struct page_info *alloc_col_domheap_page( - struct domain *d, unsigned int memflags) -{ - return NULL; -} - static inline uint64_t get_max_colors(void) { return 0; } -static inline void free_col_heap_page(struct page_info *pg) -{ - return; -} - static inline void coloring_dump_info(struct domain *d) { return; diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h index 1479ba6703..4c6e0f4d72 100644 --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -290,6 +290,9 @@ struct page_info /* When in use as a shadow, next shadow in this hash chain. */ __pdx_t next_shadow; }; + + /* Is page managed by the cache-colored allocator? */ + bool colored; }; #undef __pdx_t diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 492cc8d634..ebe0d356be 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -210,6 +210,31 @@ unsigned int online_page(mfn_t mfn, uint32_t *status); int offline_page(mfn_t mfn, int broken, uint32_t *status); int query_page_offline(mfn_t mfn, uint32_t *status); +/* Colored suballocator. */ +#ifdef CONFIG_COLORING +bool init_col_heap_pages(struct page_info *pg, unsigned long nr_pages); +struct page_info *alloc_col_domheap_page( + struct domain *d, unsigned int memflags); +void free_col_heap_page(struct page_info *pg); +#else +static inline bool init_col_heap_pages( + struct page_info *pg, unsigned long nr_pages) +{ + return false; +} + +static inline struct page_info *alloc_col_domheap_page( + struct domain *d, unsigned int memflags) +{ + return NULL; +} + +static inline void free_col_heap_page(struct page_info *pg) +{ + return; +} +#endif + void heap_init_late(void); int assign_pages(