]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
Fix x86 build
authorLuca Miccio <206497@studenti.unimore.it>
Mon, 6 Jan 2020 15:51:53 +0000 (16:51 +0100)
committerLuca Miccio <206497@studenti.unimore.it>
Tue, 7 Jan 2020 09:49:34 +0000 (10:49 +0100)
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>
xen/common/page_alloc.c
xen/common/vmap.c
xen/include/asm-arm/coloring.h
xen/include/asm-x86/mm.h
xen/include/xen/mm.h

index 6159cc316e5bfdecaa0af3edcb6f0461b6e2b214..f628a12c35d574d11e71203cf95dadafc927db86 100644 (file)
 #include <asm/page.h>
 #include <asm/numa.h>
 #include <asm/flushtlb.h>
-#include <asm/coloring.h>
 #ifdef CONFIG_X86
 #include <asm/guest.h>
 #include <asm/p2m.h>
@@ -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);
index 571c895703dbdc6cddbb203a0261b22a0cb1c30d..a1c5846cc7ce24895af57f913a85b2bc9b629b87 100644 (file)
@@ -8,7 +8,6 @@
 #include <xen/types.h>
 #include <xen/vmap.h>
 #include <asm/page.h>
-#include <asm/coloring.h>
 
 static DEFINE_SPINLOCK(vm_lock);
 static void *__read_mostly vm_base[VMAP_REGION_NR];
index 3b477121eaef44ef28639c98fbf140d9f6f6e5e4..bf8497afda15daf684b18c4b7c95e3ac277bb19e 100644 (file)
@@ -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;
index 1479ba6703764475fda3b7fb647b2236cda05a70..4c6e0f4d721de2023a8dca0514f2897c9c64ec94 100644 (file)
@@ -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
index 492cc8d63455f36f9bd5bbf558a6a65c73f23c83..ebe0d356beebcb98db2c3bfea38fc01448727af8 100644 (file)
@@ -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(